X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FgdcmDicomDirSerie.cxx;h=f9e2d6309da29b7445ff64faae578998542d0aad;hb=e62d57cbd05c8e864fd2ba197a271cdcac9a2128;hp=f632168cee5452aef7c872b6755a2bb3fac99fdc;hpb=30d2b02b938fe912d866b40ca2b9842961481ab2;p=gdcm.git diff --git a/src/gdcmDicomDirSerie.cxx b/src/gdcmDicomDirSerie.cxx index f632168c..f9e2d630 100644 --- a/src/gdcmDicomDirSerie.cxx +++ b/src/gdcmDicomDirSerie.cxx @@ -1,5 +1,21 @@ -// gdcmDicomDirSerie.cxx -//----------------------------------------------------------------------------- +/*========================================================================= + + Program: gdcm + Module: $RCSfile: gdcmDicomDirSerie.cxx,v $ + Language: C++ + Date: $Date: 2004/09/24 11:39:21 $ + Version: $Revision: 1.15 $ + + Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de + l'Image). All rights reserved. See Doc/License.txt or + http://www.creatis.insa-lyon.fr/Public/Gdcm/License.htm for details. + + This software is distributed WITHOUT ANY WARRANTY; without even + the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + PURPOSE. See the above copyright notices for more information. + +=========================================================================*/ + #include "gdcmDicomDirSerie.h" #include "gdcmDicomDirElement.h" #include "gdcmGlobal.h" @@ -9,16 +25,22 @@ /** * \brief Constructor * @param s SQ Item holding the elements related to this "SERIE" part - * @param ptagHT pointer to the HTable (gdcmObject needs it + * @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it * to build the gdcmDocEntries) */ -gdcmDicomDirSerie::gdcmDicomDirSerie(gdcmSQItem *s, TagDocEntryHT *ptagHT): - gdcmObject(ptagHT) +gdcmDicomDirSerie::gdcmDicomDirSerie(gdcmSQItem* s, TagDocEntryHT* ptagHT): + gdcmDicomDirObject(ptagHT) { docEntries = s->GetDocEntries(); } -gdcmDicomDirSerie::gdcmDicomDirSerie(TagDocEntryHT *ptagHT): - gdcmObject(ptagHT) + +/** + * \brief Constructor + * @param ptagHT pointer to the HTable (gdcmDicomDirObject needs it + * to build the gdcmDocEntries) + */ +gdcmDicomDirSerie::gdcmDicomDirSerie(TagDocEntryHT* ptagHT): + gdcmDicomDirObject(ptagHT) { } /** @@ -26,7 +48,9 @@ gdcmDicomDirSerie::gdcmDicomDirSerie(TagDocEntryHT *ptagHT): */ gdcmDicomDirSerie::~gdcmDicomDirSerie() { - for(ListDicomDirImage::iterator cc = images.begin();cc != images.end();++cc) + for(ListDicomDirImage::iterator cc = images.begin(); + cc != images.end(); + ++cc) { delete *cc; } @@ -38,30 +62,49 @@ gdcmDicomDirSerie::~gdcmDicomDirSerie() * \brief Prints the Object * @return */ -void gdcmDicomDirSerie::Print(std::ostream &os) +void gdcmDicomDirSerie::Print(std::ostream& os) { - os<<"SERIE"<SetPrintLevel(printLevel); + (*cc)->SetPrintLevel(PrintLevel); (*cc)->Print(os); } } //----------------------------------------------------------------------------- // Public + +/** + * \brief Writes the Object + * @return + */ +void gdcmDicomDirSerie::Write(FILE* fp, FileType t) +{ + gdcmDicomDirObject::Write(fp, t); + + for(ListDicomDirImage::iterator cc = images.begin();cc!=images.end();++cc) + { + (*cc)->Write( fp, t ); + } +} + /** - * \brief adds a new Image to a partially created DICOMDIR + * \brief adds a new Image (with the basic elements) to a partially created DICOMDIR */ -gdcmDicomDirImage * gdcmDicomDirSerie::NewImage(void) { - std::list elemList; - elemList=gdcmGlobal::GetDicomDirElements()->GetDicomDirImageElements(); - - gdcmDicomDirImage *st = new gdcmDicomDirImage(ptagHT); +gdcmDicomDirImage* gdcmDicomDirSerie::NewImage() +{ + std::list elemList = + gdcmGlobal::GetDicomDirElements()->GetDicomDirImageElements(); + + gdcmDicomDirImage* st = new gdcmDicomDirImage(PtagHT); FillObject(elemList); images.push_front(st); + return st; } //-----------------------------------------------------------------------------