From 0a1608386ba3efecc37edd3a280c0eedef7f0dea Mon Sep 17 00:00:00 2001 From: jpr Date: Thu, 5 Jul 2007 10:53:48 +0000 Subject: [PATCH] Fix comments --- src/gdcmFileHelper.cxx | 36 ++++++++++-------------------------- src/gdcmFileHelper.h | 22 +++++++++------------- 2 files changed, 19 insertions(+), 39 deletions(-) diff --git a/src/gdcmFileHelper.cxx b/src/gdcmFileHelper.cxx index a8bdb5e5..c45142e1 100644 --- a/src/gdcmFileHelper.cxx +++ b/src/gdcmFileHelper.cxx @@ -4,8 +4,8 @@ Module: $RCSfile: gdcmFileHelper.cxx,v $ Language: C++ - Date: $Date: 2007/07/05 10:37:53 $ - Version: $Revision: 1.115 $ + Date: $Date: 2007/07/05 10:53:48 $ + Version: $Revision: 1.116 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -51,8 +51,8 @@ gdcm::File *f = new gdcm::File(fileName); // user may also decide he doesn't want to load some parts of the header gdcm::File *f = new gdcm::File(); f->SetFileName(fileName); - f->SetLoadMode(LD_NOSEQ); // or - f->SetLoadMode(LD_NOSHADOW); // or + f->SetLoadMode(LD_NOSEQ); // or + f->SetLoadMode(LD_NOSHADOW); // or f->SetLoadMode(LD_NOSEQ | LD_NOSHADOW); // or f->SetLoadMode(LD_NOSHADOWSEQ); f->Load(); @@ -818,11 +818,7 @@ bool FileHelper::Write(std::string const &fileName) //----------------------------------------------------------------------------- // Protected /** - * \brief Checks the write integrity - * - * The tests made are : - * - verify the size of the image to write with the possible write - * when the user set an image data + * \brief * \brief Verifies the size of the user given PixelData * @return true if check is successfull */ bool FileHelper::CheckWriteIntegrity() @@ -878,8 +874,8 @@ bool FileHelper::CheckWriteIntegrity() * \brief Updates the File to write RAW data (as opposed to RGB data) * (modifies, when necessary, photochromatic interpretation, * bits allocated, Pixels element VR) - * WARNING : if SetPhotometricInterpretationToMonochrome1() was called before - * Pixel Elements if modified :-( + * WARNING : if SetPhotometricInterpretationToMonochrome1() was called + * before Pixel Elements if modified :-( */ void FileHelper::SetWriteToRaw() { @@ -890,6 +886,7 @@ void FileHelper::SetWriteToRaw() } else { + // 0x0028,0x0004 : Photometric Interpretation DataEntry *photInt = CopyDataEntry(0x0028,0x0004,"CS"); if (FileInternal->HasLUT() ) { @@ -922,15 +919,10 @@ void FileHelper::SetWriteToRaw() pixel->SetFlag(DataEntry::FLAG_PIXELDATA); pixel->SetBinArea(PixelWriteConverter->GetData(),false); pixel->SetLength(PixelWriteConverter->GetDataSize()); - - - /// \TODO : fixme : I'm not too much happy with this feature : - /// It modifies the Pixel Data - /// If user calls twice the writer, images will not be equal !!! + if (!FileInternal->HasLUT() && GetPhotometricInterpretation() == 1) { - ConvertFixGreyLevels(PixelWriteConverter->GetData(), - PixelWriteConverter->GetDataSize()); + ConvertFixGreyLevels( pixel->GetBinArea(), pixel->GetLength() ); } Archive->Push(photInt); @@ -1156,14 +1148,6 @@ void FileHelper::SetWriteFileTypeToImplicitVR() tss->Delete(); } - -/** - * \brief Restore in the File the initial group 0002 - */ -void FileHelper::RestoreWriteFileType() -{ -} - /** * \brief Set the Write not to Libido format */ diff --git a/src/gdcmFileHelper.h b/src/gdcmFileHelper.h index c483b2bb..79919736 100644 --- a/src/gdcmFileHelper.h +++ b/src/gdcmFileHelper.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmFileHelper.h,v $ Language: C++ - Date: $Date: 2007/07/04 10:40:56 $ - Version: $Revision: 1.48 $ + Date: $Date: 2007/07/05 10:53:48 $ + Version: $Revision: 1.49 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -78,7 +78,7 @@ public: DataEntry *InsertEntryString(std::string const &content, uint16_t group, uint16_t elem, const VRKey &vr); DataEntry *InsertEntryBinArea(uint8_t *binArea, int lgth, - uint16_t group, uint16_t elem, const VRKey &vr); + uint16_t group, uint16_t elem, const VRKey &vr); SeqEntry *InsertSeqEntry(uint16_t group, uint16_t elem); // File helpers @@ -88,7 +88,7 @@ public: uint8_t *GetImageData(); uint8_t *GetImageDataRaw(); -// GDCM_LEGACY(size_t GetImageDataIntoVector(void *destination,size_t maxSize)) +// GDCM_LEGACY(size_t GetImageDataIntoVector(void *destination,size_t maxSize)) void SetImageData(uint8_t *data, size_t expectedSize); @@ -119,11 +119,7 @@ public: /// (as opposed to 'Grey pixels + Palettes color') void SetWriteModeToRGB() { SetWriteMode(WMODE_RGB); } /// \brief Sets the Write Mode ( ) - void SetWriteMode(FileMode mode) { - WriteMode = mode; - // Deal with Samples per Pixel - //if (mode == WMODE_RGB) FileInternal->InsertEntryString("3",0x0028,0x0002); - } + void SetWriteMode(FileMode mode) { WriteMode = mode; } /// \brief Gets the Write Mode ( ) FileMode GetWriteMode() { return WriteMode; } @@ -149,13 +145,13 @@ public: FileType GetWriteType() { return WriteType; } /// \brief 1 : white=0, black=high value void SetPhotometricInterpretationToMonochrome1() { - PhotometricInterpretation = 1;} + PhotometricInterpretation = 1;} /// \brief 2 : black=0, white=high value (default) void SetPhotometricInterpretationToMonochrome2() { - PhotometricInterpretation = 2;} - + PhotometricInterpretation = 2;} + /// \brief 1 : white=0, black=high value int GetPhotometricInterpretation() { - return PhotometricInterpretation; } + return PhotometricInterpretation; } // Write pixels of ONE image on hard drive // No test is made on processor "endianness" -- 2.48.1