Program: gdcm
Module: $RCSfile: gdcmDataEntry.cxx,v $
Language: C++
- Date: $Date: 2007/08/27 16:14:47 $
- Version: $Revision: 1.46 $
+ Date: $Date: 2007/08/29 15:30:48 $
+ Version: $Revision: 1.47 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
*/
void DataEntry::WriteContent(std::ofstream *fp, FileType filetype,
- bool insideMetaElements)
+ bool insideMetaElements, bool insideSequence)
{
// writes the 'common part'
- DocEntry::WriteContent(fp, filetype, insideMetaElements);
+ DocEntry::WriteContent(fp, filetype, insideMetaElements, insideSequence);
if ( GetGroup() == 0xfffe )
{
Program: gdcm
Module: $RCSfile: gdcmDataEntry.h,v $
Language: C++
- Date: $Date: 2007/08/22 16:14:03 $
- Version: $Revision: 1.19 $
+ Date: $Date: 2007/08/29 15:30:48 $
+ Version: $Revision: 1.20 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
// Write
virtual void WriteContent(std::ofstream *fp, FileType filetype,
- bool insideMetaElements );
+ bool insideMetaElements, bool insideSequence);
uint32_t ComputeFullLength();
// Set/Get data
Program: gdcm
Module: $RCSfile: gdcmDicomDir.cxx,v $
Language: C++
- Date: $Date: 2007/07/26 08:36:49 $
- Version: $Revision: 1.194 $
+ Date: $Date: 2007/08/29 15:30:48 $
+ Version: $Revision: 1.195 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
binary_write( *fp, "DICM");
DicomDirMeta *ptrMeta = GetMeta();
- ptrMeta->WriteContent(fp, ExplicitVR, true);
+ ptrMeta->WriteContent(fp, ExplicitVR, true, false);
// force writing 0004|1220 [SQ ], that CANNOT exist within DicomDirMeta
for(i=0;i<6;++i)
cc != Patients.end();
++cc )
{
- (*cc)->WriteContent( fp, ExplicitVR, false );
+ (*cc)->WriteContent( fp, ExplicitVR, false, true );
}
// force writing Sequence Delimitation Item
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.cxx,v $
Language: C++
- Date: $Date: 2007/07/26 08:36:49 $
- Version: $Revision: 1.38 $
+ Date: $Date: 2007/08/29 15:30:48 $
+ Version: $Revision: 1.39 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/**
* \brief Writes the Meta Elements
* @param fp ofstream to write to
- * @param filetype type of the file (ImplicitVR, ExplicitVR, ...)
+ * @param filetype type of the file (ImplicitVR, ExplicitVR, JPEG, JPEG2000 ...)
* @return
*/
void DicomDirMeta::WriteContent(std::ofstream *fp, FileType filetype,
- bool insideMetaElements)
+ bool dummy, bool dummy2)
{
// 'File Meta Information Version'
++i)
{
// true : we are in MetaElements
- (*i)->WriteContent(fp, filetype, true);
+ (*i)->WriteContent(fp, filetype, true, false);
}
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirMeta.h,v $
Language: C++
- Date: $Date: 2007/08/22 16:14:03 $
- Version: $Revision: 1.24 $
+ Date: $Date: 2007/08/29 15:30:48 $
+ Version: $Revision: 1.25 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
static DicomDirMeta *New(bool empty=false) {return new DicomDirMeta(empty);}
virtual void Print(std::ostream &os = std::cout, std::string const &indent = "" );
- virtual void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements);
+ virtual void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements, bool insideSequence);
int ComputeGroup0002Length( );
protected:
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.cxx,v $
Language: C++
- Date: $Date: 2007/07/26 08:36:49 $
- Version: $Revision: 1.42 $
+ Date: $Date: 2007/08/29 15:30:48 $
+ Version: $Revision: 1.43 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param fp ofstream to write to
* @param t Type of the File (explicit VR, implicitVR, ...)
*/
-void DicomDirPatient::WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements)
+void DicomDirPatient::WriteContent(std::ofstream *fp, FileType t, bool dummy, bool dummy2)
{
- DicomDirObject::WriteContent(fp, t, false);
+ DicomDirObject::WriteContent(fp, t, false, true);
for(ListDicomDirStudy::iterator cc = Studies.begin();
cc!= Studies.end();
++cc )
{
- (*cc)->WriteContent( fp, t, false );
+ (*cc)->WriteContent( fp, t, false, true );
}
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirPatient.h,v $
Language: C++
- Date: $Date: 2007/08/22 16:14:03 $
- Version: $Revision: 1.34 $
+ Date: $Date: 2007/08/29 15:30:48 $
+ Version: $Revision: 1.35 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
static DicomDirPatient *New(bool empty=false) {return new DicomDirPatient(empty);}
void Print(std::ostream &os = std::cout, std::string const &indent = "" );
- void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements);
+ void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements, bool insideSequence );
// Patient methods
/// \brief Adds a new gdcm::DicomDirStudy to the Patient
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.cxx,v $
Language: C++
- Date: $Date: 2007/07/26 08:36:49 $
- Version: $Revision: 1.44 $
+ Date: $Date: 2007/08/29 15:30:49 $
+ Version: $Revision: 1.45 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param fp ofstream to write to
* @param t Type of the File (explicit VR, implicitVR, ...)
*/
-void DicomDirSerie::WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements)
+void DicomDirSerie::WriteContent(std::ofstream *fp, FileType t, bool dummy, bool dummy2)
{
- DicomDirObject::WriteContent(fp, t, false);
+ DicomDirObject::WriteContent(fp, t, false, true);
for(ListDicomDirImage::iterator cc = Images.begin();
cc!= Images.end();
++cc )
{
- (*cc)->WriteContent( fp, t, false );
+ (*cc)->WriteContent( fp, t, false, true );
}
for(ListDicomDirPrivate::iterator cc2 = Privates.begin();
cc2!= Privates.end();
++cc2 )
{
- (*cc2)->WriteContent( fp, t, false);
+ (*cc2)->WriteContent( fp, t, false, true);
}
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.h,v $
Language: C++
- Date: $Date: 2007/08/22 16:14:03 $
- Version: $Revision: 1.37 $
+ Date: $Date: 2007/08/29 15:30:49 $
+ Version: $Revision: 1.38 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
static DicomDirSerie *New(bool empty=false) {return new DicomDirSerie(empty);}
void Print( std::ostream &os = std::cout, std::string const &indent = "" );
- void WriteContent( std::ofstream *fp, FileType t, bool insideMetaElements );
+ void WriteContent( std::ofstream *fp, FileType t, bool insideMetaElements,
+ bool insideSequence );
// 'Image' methods
DicomDirImage *NewImage();
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.cxx,v $
Language: C++
- Date: $Date: 2007/07/26 08:36:49 $
- Version: $Revision: 1.44 $
+ Date: $Date: 2007/08/29 15:30:49 $
+ Version: $Revision: 1.45 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param t Type of the File (explicit VR, implicitVR, ...)
* @return
*/
-void DicomDirStudy::WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements)
+void DicomDirStudy::WriteContent(std::ofstream *fp, FileType t, bool dummy, bool dummy2)
{
- DicomDirObject::WriteContent(fp, t, false);
+ DicomDirObject::WriteContent(fp, t, false, true);
for(ListDicomDirSerie::iterator cc = Series.begin();
cc!= Series.end();
++cc )
{
- (*cc)->WriteContent( fp, t, false );
+ (*cc)->WriteContent( fp, t, false, true );
}
for(ListDicomDirVisit::iterator icc = Visits.begin();
icc!= Visits.end();
++icc )
{
- (*icc)->WriteContent( fp, t, false );
+ (*icc)->WriteContent( fp, t, false, true );
}
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirStudy.h,v $
Language: C++
- Date: $Date: 2007/08/22 16:14:03 $
- Version: $Revision: 1.36 $
+ Date: $Date: 2007/08/29 15:30:49 $
+ Version: $Revision: 1.37 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
static DicomDirStudy *New(bool empty=false) {return new DicomDirStudy(empty);}
void Print(std::ostream &os = std::cout, std::string const &indent = "" );
- void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements);
+ void WriteContent(std::ofstream *fp, FileType t, bool insideMetaElements,bool insideSequence );
// 'Serie' methods
DicomDirSerie *NewSerie();
Program: gdcm
Module: $RCSfile: gdcmDocEntry.cxx,v $
Language: C++
- Date: $Date: 2007/08/28 09:29:26 $
- Version: $Revision: 1.92 $
+ Date: $Date: 2007/08/29 15:30:49 $
+ Version: $Revision: 1.93 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param fp already open ofstream pointer
* @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, JPEG, JPEG2000...)
*/
-void DocEntry::WriteContent(std::ofstream *fp, FileType filetype, bool insideMetaElements)
+void DocEntry::WriteContent(std::ofstream *fp, FileType filetype, bool insideMetaElements, bool insideSequence)
{
uint32_t ffff = 0xffffffff;
uint16_t group = GetGroup();
|| (vr == "UN") || (vr == "UT") )
{
binary_write(*fp, zero);
- if ( (filetype == JPEG || filetype == JPEG2000) && group == 0x7fe0 && elem == 0x0010)
- {
- // gdcmAssertMacro( GetVR() == "OW" ); //?!?
+
+ if ( (filetype == JPEG || filetype == JPEG2000) && group == 0x7fe0 && elem == 0x0010 && !insideSequence)
+ {
+ // Only the 'true' Pixel Element may be compressed (hope so!)
binary_write(*fp, ffff);
}
else if (vr == "SQ")
Program: gdcm
Module: $RCSfile: gdcmDocEntry.h,v $
Language: C++
- Date: $Date: 2007/08/22 16:14:04 $
- Version: $Revision: 1.69 $
+ Date: $Date: 2007/08/29 15:30:49 $
+ Version: $Revision: 1.70 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
public:
virtual void Print (std::ostream &os = std::cout, std::string const &indent = "");
virtual void WriteContent(std::ofstream *fp, FileType filetype,
- bool insideMetaElements);
+ bool insideMetaElements, bool insideSequence);
/// \brief Gets the DicEntry of the current Dicom entry
/// @return The DicEntry of the current Dicom entry
Program: gdcm
Module: $RCSfile: gdcmDocEntrySet.h,v $
Language: C++
- Date: $Date: 2007/08/22 16:14:04 $
- Version: $Revision: 1.71 $
+ Date: $Date: 2007/08/29 15:30:49 $
+ Version: $Revision: 1.72 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
public:
/// \brief write any type of entry to the entry set
virtual void WriteContent (std::ofstream *fp, FileType filetype,
- bool insideMetaElements) = 0;
+ bool insideMetaElements,bool insideSequence ) = 0;
/// \brief Remove all Entry of the current set
virtual void ClearEntry() = 0;
Program: gdcm
Module: $RCSfile: gdcmDocument.cxx,v $
Language: C++
- Date: $Date: 2007/08/21 12:51:09 $
- Version: $Revision: 1.367 $
+ Date: $Date: 2007/08/29 15:30:49 $
+ Version: $Revision: 1.368 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* --> was too much tricky / we were [in a hurry / too lazy]
* --> We don't write the element 0x0000 (group length)
*/
-
- ElementSet::WriteContent(fp, filetype, false); // This one is recursive
+ // This one is recursive
+ // false : outside MetaElements
+ // false : outside Sequence
+ ElementSet::WriteContent(fp, filetype, false, false);
}
// -----------------------------------------
Program: gdcm
Module: $RCSfile: gdcmElementSet.cxx,v $
Language: C++
- Date: $Date: 2007/07/26 08:36:49 $
- Version: $Revision: 1.77 $
+ Date: $Date: 2007/08/29 15:30:49 $
+ Version: $Revision: 1.78 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param fp ofstream to write to
* @param filetype ExplicitVR/ImplicitVR/ACR/ACR_LIBIDO/JPEG/JPEG2000/...
*/
-void ElementSet::WriteContent(std::ofstream *fp, FileType filetype, bool dummy)
+void ElementSet::WriteContent(std::ofstream *fp, FileType filetype, bool dummy, bool dummy2)
{
bool insideMetaElements = false;
bool yetOutsideMetaElements = false;
+ int countSQ =0;
for (TagDocEntryHT::const_iterator i = TagHT.begin();
i != TagHT.end();
( (i->second)->GetGroup() == 0x0002
||( (filetype == ACR || filetype == ACR_LIBIDO ) && (i->second)->GetGroup() == 0x0008 ) )
)
- {
+ {
// There are DocEntries, written recursively
- i->second->WriteContent(fp, filetype, insideMetaElements );
+ // false : we are outside any Sequence
+ i->second->WriteContent(fp, filetype, insideMetaElements, false );
}
}
}
Program: gdcm
Module: $RCSfile: gdcmElementSet.h,v $
Language: C++
- Date: $Date: 2007/08/22 16:14:04 $
- Version: $Revision: 1.57 $
+ Date: $Date: 2007/08/29 15:30:49 $
+ Version: $Revision: 1.58 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
std::string const &indent = "" );
void WriteContent(std::ofstream *fp, FileType filetype,
- bool insideMetaElements);
+ bool insideMetaElements, bool insideSequence);
bool AddEntry(DocEntry *Entry);
bool RemoveEntry(DocEntry *EntryToRemove);
Program: gdcm
Module: $RCSfile: gdcmSQItem.cxx,v $
Language: C++
- Date: $Date: 2007/07/26 08:36:49 $
- Version: $Revision: 1.86 $
+ Date: $Date: 2007/08/29 15:30:49 $
+ Version: $Revision: 1.87 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
*/
void SQItem::WriteContent(std::ofstream *fp, FileType filetype,
- bool insideMetaElements)
+ bool insideMetaElements, bool dummy2)
{
int j;
uint16_t item[4] = { 0xfffe, 0xe000, 0xffff, 0xffff };
// contains 'impossible tag' fffe|0000 in last position !
}
// false : we are not in MetaElements
- (*it)->WriteContent(fp, filetype, false);
+ // true : we are inside a Sequence
+ (*it)->WriteContent(fp, filetype, false, true);
}
//we force the writting of an 'Item Delimitation' item
Program: gdcm
Module: $RCSfile: gdcmSQItem.h,v $
Language: C++
- Date: $Date: 2007/08/22 16:14:04 $
- Version: $Revision: 1.54 $
+ Date: $Date: 2007/08/29 15:30:50 $
+ Version: $Revision: 1.55 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
virtual void Print(std::ostream &os = std::cout,
std::string const &indent = "" );
- void WriteContent(std::ofstream *fp, FileType filetype, bool insideMetaElements);
+ void WriteContent(std::ofstream *fp, FileType filetype,
+ bool insideMetaElements, bool insideSequence);
uint32_t ComputeFullLength();
bool AddEntry(DocEntry *Entry); // add to the List
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.cxx,v $
Language: C++
- Date: $Date: 2007/07/26 08:36:49 $
- Version: $Revision: 1.69 $
+ Date: $Date: 2007/08/29 15:30:50 $
+ Version: $Revision: 1.70 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* @param fp pointer to an already open file
* @param filetype type of the file (ACR, ImplicitVR, ExplicitVR, ...)
*/
-void SeqEntry::WriteContent(std::ofstream *fp, FileType filetype, bool dummy)
+void SeqEntry::WriteContent(std::ofstream *fp, FileType filetype, bool dummy, bool dummy2)
{
uint16_t seq_term_gr = 0xfffe;
uint16_t seq_term_el = 0xe0dd;
if ( GetReadLength() == 0 )
return;
// false : we are not in MetaElements
- DocEntry::WriteContent(fp, filetype, false);
+ // true : we are inside a Sequence
+ DocEntry::WriteContent(fp, filetype, false, true);
for(ListSQItem::iterator cc = Items.begin();
cc != Items.end();
++cc)
{
- (*cc)->WriteContent(fp, filetype, false);
+ (*cc)->WriteContent(fp, filetype, false, true);
}
// we force the writting of a Sequence Delimitation item
Program: gdcm
Module: $RCSfile: gdcmSeqEntry.h,v $
Language: C++
- Date: $Date: 2007/08/22 16:14:04 $
- Version: $Revision: 1.45 $
+ Date: $Date: 2007/08/29 15:30:50 $
+ Version: $Revision: 1.46 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{return new SeqEntry(group,elem);}
void Print(std::ostream &os = std::cout, std::string const &indent = "" );
- void WriteContent(std::ofstream *fp, FileType filetype, bool insideMetaElements);
+ void WriteContent(std::ofstream *fp, FileType filetype,
+ bool insideMetaElements, bool insideSequence);
uint32_t ComputeFullLength();
void AddSQItem(SQItem *it, int itemNumber);