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
// 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();
//-----------------------------------------------------------------------------
// 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()
* \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()
{
}
else
{
+ // 0x0028,0x0004 : Photometric Interpretation
DataEntry *photInt = CopyDataEntry(0x0028,0x0004,"CS");
if (FileInternal->HasLUT() )
{
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);
tss->Delete();
}
-
-/**
- * \brief Restore in the File the initial group 0002
- */
-void FileHelper::RestoreWriteFileType()
-{
-}
-
/**
* \brief Set the Write not to Libido format
*/
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
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
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);
/// (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; }
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"