+2004-10-13 Eric Boix <Eric.Boix@creatis.insa-lyon.fr>
+ * Doc/Website/MailingList.html added (Sidebar.html changed accordingly).
+ * gdcmPython/gdcm.i: fix for compilation of wrappers (Note: %include order
+ matters, as stated in warning note at begining of %include section).
+ * src/gdcmDicomDir*.[cxx|h]: coding style
+ * src/gdcmDocument.h: doxygen \ref seems uncompatible with \todo.
+ * src/gdcmJpeg8.cxx: doxygen fix.
+ * CLEANUP_ROUND (12) for gdcmPixelConvert (seing the ligth stage)
+ src/gdcmFile.[cxx|h] and gdcmPixelConvert.[cxx|h]: color handling moved
+ from File:: to PixelConvert::.
+
2004-10-12 Eric Boix <Eric.Boix@creatis.insa-lyon.fr>
* CLEANUP_ROUND (11) for gdcmPixelConvert (cafeine is my friend stage)
src/gdcmFile.[cxx|h] and gdcmPixelConvert.[cxx|h]:
--- /dev/null
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<HTML>
+<HEAD>
+ <META http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
+ <TITLE>Gdcm mailing list</TITLE>
+</HEAD>
+
+<BODY>
+
+<!#######################################################################>
+<H1>
+ Gdcm mailing list
+</H1>
+<HR size="1"><ADDRESS style="align: right;"></ADDRESS>
+
+<!#######################################################################>
+The
+<A HREF="http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib">
+gdcm mailing list</A>
+has currently two flaws (unitl we fix that)
+<UL>
+ <LI> it is awkwardly named
+ <TT>Dcmlib@creatis.insa-lyon.fr</TT>
+ (i.e. <TT>Dcmlib</TT> as opposed to the expected <TT>gdcm</TT>),
+ </LI>
+ <LI> since the developpers are mainly french (sorry) the
+ <A HREF="http://www.creatis.insa-lyon.fr/pipermail/dcmlib/">
+ archives</A> are in french (sorry again). But if you post
+ a question in english we'll promiss to answer in basic english !
+ </LI>
+</UL>
+<A HREF="http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib">
+Gdcm mailing list web page</A>
+allows you subscribe and/or to perform any administrative task on this
+mailing list.
+<BR>
+
+<!#######################################################################>
+<HR size="1"><ADDRESS style="align: right;"></ADDRESS>
+
+</BODY>
+</HTML>
</LI>
<LI> the python wrappers to be fixed,
</LI>
-<LI> a simple wxWdiget Dicom file editor.
+<LI> a simple
+ <A HREF="http://www.wxwindows.org/">wxWidgets</A>
+ Dicom file editor.
</LI>
</UL>
</UL>
</FONT> </B> </TD>
</TR>
+ <TR><TD BGCOLOR="#99ccff">
+ <A HREF="MailingList.html"
+ target="rite">
+ Mailing list</A>
+ </TD></TR>
+
<TR><TD BGCOLOR="#99ccff">
<A HREF="Installation.html"
target="rite">
%include "gdcmTS.h"
%include "gdcmVR.h"
%include "gdcmSQItem.h"
+%include "gdcmDicomDirElement.h"
%include "gdcmDicomDirObject.h"
+%include "gdcmDicomDirImage.h"
+%include "gdcmDicomDirSerie.h"
%include "gdcmDicomDirStudy.h"
%include "gdcmDicomDirPatient.h"
-%include "gdcmDicomDirSerie.h"
-%include "gdcmDicomDirElement.h"
%include "gdcmDicomDirMeta.h"
%include "gdcmDocument.h"
%include "gdcmHeader.h"
%include "gdcmUtil.h"
%include "gdcmGlobal.h"
%include "gdcmDicomDir.h"
-%include "gdcmDicomDirElement.h"
-%include "gdcmDicomDirImage.h"
Program: gdcm
Module: $RCSfile: gdcmDebug.cxx,v $
Language: C++
- Date: $Date: 2004/10/12 04:35:44 $
- Version: $Revision: 1.8 $
+ Date: $Date: 2004/10/13 14:15:29 $
+ Version: $Revision: 1.9 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
{
return ;
}
- std::cerr << msg1 << ' ' << msg2 << std::endl;
+ std::cerr << "gdcm::" << msg1 << ' ' << msg2 << std::endl;
}
/**
{
return;
}
- std::cerr << msg1 << ' ' << msg2 << std::endl;
+ std::cerr << "gdcm::" << msg1 << ' ' << msg2 << std::endl;
Exit(1);
}
void Debug::Error(const char* msg1, const char* msg2,
const char* msg3)
{
- std::cerr << msg1 << ' ' << msg2 << ' ' << msg3 << std::endl;
+ std::cerr << "gdcm::" << msg1 << ' ' << msg2 << ' ' << msg3 << std::endl;
Exit(1);
}
}
if (!test)
{
- std::cerr << msg1 << ' ' << msg2 << std::endl;
+ std::cerr << "gdcm::" << msg1 << ' ' << msg2 << std::endl;
}
}
Program: gdcm
Module: $RCSfile: gdcmDicomDirElement.h,v $
Language: C++
- Date: $Date: 2004/10/12 04:35:44 $
- Version: $Revision: 1.12 $
+ Date: $Date: 2004/10/13 14:15:29 $
+ Version: $Revision: 1.13 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief returns a reference to the chained List
* related to the META Elements of a DICOMDIR.
*/
- ListDicomDirMetaElem &GetDicomDirMetaElements()
+ ListDicomDirMetaElem& GetDicomDirMetaElements()
{ return DicomDirMetaList; };
/**
Program: gdcm
Module: $RCSfile: gdcmDicomDirObject.cxx,v $
Language: C++
- Date: $Date: 2004/10/12 04:35:45 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2004/10/13 14:15:29 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief add the 'Object' related Dicom Elements to the listEntries
* of a partially created DICOMDIR
*/
-void DicomDirObject::FillObject(std::list<Element> elemList)
+void DicomDirObject::FillObject(ListDicomDirMetaElem elemList)
{
// FillObject rempli le SQItem qui sera accroche au bon endroit
Program: gdcm
Module: $RCSfile: gdcmDicomDirObject.h,v $
Language: C++
- Date: $Date: 2004/10/12 04:35:45 $
- Version: $Revision: 1.4 $
+ Date: $Date: 2004/10/13 14:15:29 $
+ Version: $Revision: 1.5 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
void SetPrintLevel(int level) { PrintLevel = level; };
TagDocEntryHT GetEntry();
- void FillObject(std::list<Element> elemList);
+ void FillObject(ListDicomDirMetaElem elemList);
protected:
Program: gdcm
Module: $RCSfile: gdcmDicomDirSerie.h,v $
Language: C++
- Date: $Date: 2004/10/12 04:35:45 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2004/10/13 14:15:29 $
+ Version: $Revision: 1.11 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT DicomDirSerie : public DicomDirObject
{
public:
- DicomDirSerie(SQItem *s, TagDocEntryHT *ptagHT);
- DicomDirSerie(TagDocEntryHT *ptagHT);
+ DicomDirSerie( SQItem* s, TagDocEntryHT* ptagHT );
+ DicomDirSerie( TagDocEntryHT* ptagHT );
~DicomDirSerie();
- virtual void Print(std::ostream &os = std::cout);
- virtual void Write(FILE *fp, FileType t);
+ virtual void Print( std::ostream& os = std::cout );
+ virtual void Write( FILE* fp, FileType t );
/**
* \ingroup DicomDirSerie
* \brief returns the IMAGE chained List for this SERIE.
*/
- ListDicomDirImage &GetDicomDirImages() { return images; };
+ ListDicomDirImage& GetDicomDirImages() { return images; };
/**
* \ingroup DicomDirSerie
* \brief adds the passed IMAGE to the IMAGE chained List for this SERIE.
Program: gdcm
Module: $RCSfile: gdcmDocEntry.h,v $
Language: C++
- Date: $Date: 2004/10/12 04:35:45 $
- Version: $Revision: 1.25 $
+ Date: $Date: 2004/10/13 14:15:29 $
+ Version: $Revision: 1.26 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
//-----------------------------------------------------------------------------
/**
- * \ingroup DocEntry
* \brief The dicom header of a Dicom file contains a set of such entries
* (when successfuly parsed against a given Dicom dictionary)
*/
Program: gdcm
Module: $RCSfile: gdcmDocument.h,v $
Language: C++
- Date: $Date: 2004/10/12 04:35:45 $
- Version: $Revision: 1.50 $
+ Date: $Date: 2004/10/13 14:15:29 $
+ Version: $Revision: 1.51 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
/// \brief Elements whose value is longer than MAX_SIZE_PRINT_ELEMENT_VALUE
/// are NOT printed.
/// \todo Currently not used since collides with #define in
- /// \ref DocEntry.cxx. See also
- /// \ref Document::SetMaxSizePrintEntry()
+ /// class DocEntry . See also
+ /// method ref Document::SetMaxSizePrintEntry()
static const unsigned int MAX_SIZE_PRINT_ELEMENT_VALUE;
/// Store the RLE frames info obtained during parsing of pixels.
Program: gdcm
Module: $RCSfile: gdcmFile.cxx,v $
Language: C++
- Date: $Date: 2004/10/13 04:05:04 $
- Version: $Revision: 1.141 $
+ Date: $Date: 2004/10/13 14:15:29 $
+ Version: $Revision: 1.142 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
PixelConverter.SetRLEInfo( &(HeaderInternal->RLEInfo) );
PixelConverter.SetJPEGInfo( &(HeaderInternal->JPEGInfo) );
PixelConverter.SetDecompressedSize( ImageDataSize );
+
+ PixelConverter.SetPlanarConfiguration(
+ HeaderInternal->GetPlanarConfiguration() );
+ PixelConverter.SetIsMonochrome( HeaderInternal->IsMonochrome() );
+ PixelConverter.SetIsPaletteColor( HeaderInternal->IsPaletteColor() );
+ PixelConverter.SetIsYBRFull( HeaderInternal->IsYBRFull() );
HeaderInternal->CloseFile();
* @return On success, the number of bytes actually copied. Zero on
* failure e.g. MaxSize is lower than necessary.
*/
-size_t File::GetImageDataIntoVectorRaw (void* destination, size_t maxSize)
+void File::GetImageDataIntoVectorRaw (void* destination, size_t maxSize)
{
// we save the initial values of the following
// in order to be able to restore the header in a disk-consistent state
{
dbg.Verbose(0, "File::GetImageDataIntoVector: pixel data bigger"
"than caller's expected MaxSize");
- return (size_t)0;
+ return;
}
FILE* fp = HeaderInternal->OpenFile();
PixelConverter.ReadAndDecompressPixelData( destination, fp );
HeaderInternal->CloseFile();
- PixelConverter.ReorderEndianity( (uint8_t*) destination );
-
- PixelConverter.ReArrangeBits( (uint8_t*) destination );
-
-#ifdef GDCM_DEBUG
- FILE* DebugFile;
- DebugFile = fopen( "SpuriousFile.RAW", "wb" );
- fwrite( PixelConvertor.GetUncompressed(),
- PixelConvertor.GetUncompressedsSize(),
- 1, DebugFile );
- fclose( DebugFile );
-#endif //GDCM_DEBUG
-
-// SPLIT ME
-//////////////////////////////////
-// Deal with the color
-
- // Monochrome pictures don't require color intervention
- if ( HeaderInternal->IsMonochrome() )
- {
- return ImageDataSize;
- }
-
- // Planar configuration = 0 : Pixels are already RGB
- // Planar configuration = 1 : 3 planes : R, G, B
- // Planar configuration = 2 : 1 gray Plane + 3 LUT
-
- // Well ... supposed to be !
- // See US-PAL-8-10x-echo.dcm: PlanarConfiguration=0,
- // PhotometricInterpretation=PALETTE COLOR
- // and heuristic has to be found :-(
-
- int planConf = HeaderInternal->GetPlanarConfiguration();
-
- // Planar configuration = 2 ==> 1 gray Plane + 3 LUT
- // ...and...
- // whatever the Planar Configuration might be, "PALETTE COLOR "
- // implies that we deal with the palette.
- if ( ( planConf == 2 ) || HeaderInternal->IsPaletteColor() )
- {
- return ImageDataSize;
- }
-
- // When planConf is 0, pixels are allready in RGB
-
- if ( planConf == 1 )
+ if ( ! PixelConverter.HandleColor( (uint8_t*)destination ) )
{
- // Warning : YBR_FULL_422 acts as RGB
- if ( HeaderInternal->IsYBRFull() )
- {
- PixelConverter.ConvertYcBcRPlanesToRGBPixels(
- (uint8_t*)destination,
- ImageDataSize );
- }
- else
- {
- PixelConverter.ConvertRGBPlanesToRGBPixels(
- (uint8_t*)destination,
- ImageDataSize );
- }
-
+ return;
}
///////////////////////////////////////////////////
HeaderInternal->SetEntryByNumber(photInt,0x0028,0x0004);
HeaderInternal->SetEntryByNumber(planConfig,0x0028,0x0006);
- return ImageDataSize;
+ return;
}
/**
Program: gdcm
Module: $RCSfile: gdcmFile.h,v $
Language: C++
- Date: $Date: 2004/10/12 09:59:45 $
- Version: $Revision: 1.61 $
+ Date: $Date: 2004/10/13 14:15:30 $
+ Version: $Revision: 1.62 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
class GDCM_EXPORT File
{
public:
- File( Header *header );
+ File( Header* header );
File( std::string const& filename );
virtual ~File();
uint8_t* GetImageData();
size_t GetImageDataIntoVector(void* destination, size_t maxSize);
uint8_t* GetImageDataRaw();
- size_t GetImageDataIntoVectorRaw(void* destination, size_t maxSize);
+ void GetImageDataIntoVectorRaw(void* destination, size_t maxSize);
// see also Header::SetImageDataSize ?!?
bool SetImageData (uint8_t* data, size_t expectedSize);
Program: gdcm
Module: $RCSfile: gdcmJpeg8.cxx,v $
Language: C++
- Date: $Date: 2004/10/12 04:35:46 $
- Version: $Revision: 1.6 $
+ Date: $Date: 2004/10/13 14:15:30 $
+ Version: $Revision: 1.7 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief routine for JPEG decompression
* @param fp pointer to an already open file descriptor
* 8 significant bits per pixel
- * @param image_buffer Points to array (of R,G,B-order) data to compress
+ * @param im_buf Points to array (of R,G,B-order) data to compress
* @param quality compression quality
* @param image_height Number of rows in image
* @param image_width Number of columns in image
Program: gdcm
Module: $RCSfile: gdcmPixelConvert.cxx,v $
Language: C++
- Date: $Date: 2004/10/13 04:05:04 $
- Version: $Revision: 1.10 $
+ Date: $Date: 2004/10/13 14:15:30 $
+ Version: $Revision: 1.11 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
* \brief Read from file a 12 bits per pixel image and uncompress it
* into a 16 bits per pixel image.
*/
-void PixelConvert::Decompress12BitsTo16Bits(
+void PixelConvert::ReadAndDecompress12BitsTo16Bits(
uint8_t* pixelZone,
FILE* filePtr)
throw ( FormatError )
ItemRead = fread( &b0, 1, 1, filePtr);
if ( ItemRead != 1 )
{
- throw FormatError( "File::Decompress12BitsTo16Bits()",
+ throw FormatError( "File::ReadAndDecompress12BitsTo16Bits()",
"Unfound first block" );
}
ItemRead = fread( &b1, 1, 1, filePtr);
if ( ItemRead != 1 )
{
- throw FormatError( "File::Decompress12BitsTo16Bits()",
+ throw FormatError( "File::ReadAndDecompress12BitsTo16Bits()",
"Unfound second block" );
}
ItemRead = fread( &b2, 1, 1, filePtr);
if ( ItemRead != 1 )
{
- throw FormatError( "File::Decompress12BitsTo16Bits()",
+ throw FormatError( "File::ReadAndDecompress12BitsTo16Bits()",
"Unfound second block" );
}
/**
* \brief Re-arrange the bits within the bytes.
- * @param fp already open File Pointer
- * @param destination Where decompressed fragments should end up
+ * @param pixelZone zone
* @return Boolean
*/
bool PixelConvert::ReArrangeBits( uint8_t* pixelZone )
* \brief Convert (Y plane, cB plane, cR plane) to RGB pixels
* \warning Works on all the frames at a time
*/
-void PixelConvert::ConvertYcBcRPlanesToRGBPixels(
- uint8_t* destination,
- size_t imageDataSize )
+void PixelConvert::ConvertYcBcRPlanesToRGBPixels( uint8_t* destination )
{
- uint8_t* oldPixelZone = new uint8_t[ imageDataSize ];
- memmove( oldPixelZone, destination, imageDataSize );
+ uint8_t* oldPixelZone = new uint8_t[ DecompressedSize ];
+ memmove( oldPixelZone, destination, DecompressedSize );
// to see the tricks about YBR_FULL, YBR_FULL_422,
// YBR_PARTIAL_422, YBR_ICT, YBR_RCT have a look at :
* \brief Convert (Red plane, Green plane, Blue plane) to RGB pixels
* \warning Works on all the frames at a time
*/
-void PixelConvert::ConvertRGBPlanesToRGBPixels(
- uint8_t* destination,
- size_t imageDataSize )
+void PixelConvert::ConvertRGBPlanesToRGBPixels( uint8_t* destination )
{
- uint8_t* oldPixelZone = new uint8_t[ imageDataSize ];
- memmove( oldPixelZone, destination, imageDataSize );
+ uint8_t* oldPixelZone = new uint8_t[ DecompressedSize ];
+ memmove( oldPixelZone, destination, DecompressedSize );
int l = XSize * YSize * ZSize;
bool PixelConvert::ReadAndDecompressPixelData( void* destination, FILE* fp )
{
+ //////////////////////////////////////////////////
+ //// First stage: get our hands on the Pixel Data.
if ( !fp )
{
+ dbg.Verbose( 0, "PixelConvert::ReadAndDecompressPixelData: "
+ "unavailable file pointer." );
return false;
}
if ( fseek(fp, PixelOffset, SEEK_SET) == -1 )
{
+ dbg.Verbose( 0, "PixelConvert::ReadAndDecompressPixelData: "
+ "unable to find PixelOffset in file." );
return false;
}
+ //////////////////////////////////////////////////
+ //// Second stage: read from disk dans uncompress.
if ( BitsAllocated == 12 )
{
- Decompress12BitsTo16Bits( (uint8_t*)destination, fp);
- return true;
+ ReadAndDecompress12BitsTo16Bits( (uint8_t*)destination, fp);
}
-
- //////////// Decompressed File
- if ( IsUncompressed )
+ else if ( IsUncompressed )
{
size_t ItemRead = fread( destination, PixelDataLength, 1, fp);
if ( ItemRead != 1 )
{
+ dbg.Verbose( 0, "PixelConvert::ReadAndDecompressPixelData: "
+ "reading of uncompressed pixel data failed." );
return false;
}
- else
+ }
+ else if ( IsRLELossless )
+ {
+ if ( ! ReadAndDecompressRLEFile( destination, fp ) )
{
- return true;
+ dbg.Verbose( 0, "PixelConvert::ReadAndDecompressPixelData: "
+ "RLE decompressor failed." );
+ return false;
}
}
+ else
+ {
+ // Default case concerns JPEG family
+ if ( ! ReadAndDecompressJPEGFile( (uint8_t*)destination, fp ) )
+ {
+ dbg.Verbose( 0, "PixelConvert::ReadAndDecompressPixelData: "
+ "JPEG decompressor failed." );
+ return false;
+ }
+ }
+
+ ////////////////////////////////////////////
+ //// Third stage: twigle the bytes and bits.
+ ReorderEndianity( (uint8_t*) destination );
+ ReArrangeBits( (uint8_t*) destination );
+
+}
+
+bool PixelConvert::HandleColor( uint8_t* destination )
+{
+ //////////////////////////////////
+ // Deal with the color decoding i.e. handle:
+ // - R, G, B planes (as opposed to RGB pixels)
+ // - YBR (various) encodings.
+ // - LUT[s] (or "PALETTE COLOR").
+ //
+ // The classification in the color decoding schema is based on the blending
+ // of two Dicom tags values:
+ // * "Photometric Interpretation" for which we have the cases:
+ // - [Photo A] MONOCHROME[1|2] pictures,
+ // - [Photo B] RGB or YBR_FULL_422 (which acts as RGB),
+ // - [Photo C] YBR_* (with the above exception of YBR_FULL_422)
+ // - [Photo D] "PALETTE COLOR" which indicates the presence of LUT[s].
+ // * "Planar Configuration" for which we have the cases:
+ // - [Planar 0] 0 then Pixels are already RGB
+ // - [Planar 1] 1 then we have 3 planes : R, G, B,
+ // - [Planar 2] 2 then we have 1 gray Plane and 3 LUTs
+ //
+ // Now in theory, one could expect some coherence when blending the above
+ // cases. For example we should not encounter files belonging at the
+ // time to case [Planar 0] and case [Photo D].
+ // Alas, this was only theory ! Because in practice some odd (read ill
+ // formated Dicom) files (e.g. gdcmData/US-PAL-8-10x-echo.dcm) we encounter:
+ // - "Planar Configuration" = 0,
+ // - "Photometric Interpretation" = "PALETTE COLOR".
+ // Hence gdcm shall use the folowing "heuristic" in order to be tolerant
+ // towards Dicom-non-conformance files:
+ // << whatever the "Planar Configuration" value might be, a
+ // "Photometric Interpretation" set to "PALETTE COLOR" forces
+ // a LUT intervention >>
+ //
+ // Now we are left with the following handling of the cases:
+ // - [Planar 0] OR [Photo A] no color decoding (since respectively
+ // Pixels are already RGB and monochrome pictures have no color :),
+ // - [Planar 1] AND [Photo B] handled with ConvertRGBPlanesToRGBPixels()
+ // - [Planar 1] AND [Photo C] handled with ConvertYcBcRPlanesToRGBPixels()
+ // - [Planar 2] OR [Photo D] requires LUT intervention.
+
+ if ( IsMonochrome
+ || ( PlanarConfiguration == 2 )
+ || IsPaletteColor )
+ {
+ // [Planar 2] OR [Photo D]: LUT intervention done outside
+ return false;
+ }
- ///////////// Run Length Encoding
- if ( IsRLELossless )
+ if ( PlanarConfiguration == 1 )
{
- return ReadAndDecompressRLEFile( destination, fp );
+ if ( IsYBRFull )
+ {
+ // [Planar 1] AND [Photo C] (remember YBR_FULL_422 acts as RGB)
+ ConvertYcBcRPlanesToRGBPixels( (uint8_t*)destination );
+ }
+ else
+ {
+ // [Planar 1] AND [Photo C]
+ ConvertRGBPlanesToRGBPixels( (uint8_t*)destination );
+ }
}
- ///////////// SingleFrame/Multiframe JPEG Lossless/Lossy/2000
- return ReadAndDecompressJPEGFile( (uint8_t*)destination, fp );
+ // When planarConf is 0, pixels are allready in RGB
+ return true;
}
void PixelConvert::ComputeDecompressedImageDataSize()
int bitsAllocated;
// Number of "Bits Allocated" is fixed to 16 when it's 12, since
// in this case we will expand the image to 16 bits (see
- // \ref Decompress12BitsTo16Bits() )
+ // \ref ReadAndDecompress12BitsTo16Bits() )
if ( BitsAllocated == 12 )
{
bitsAllocated = 16;
}
} // end namespace gdcm
+
+// NOTES on File internal calls
+// User
+// ---> GetImageData
+// ---> GetImageDataIntoVector
+// |---> GetImageDataIntoVectorRaw
+// | lut intervention
+// User
+// ---> GetImageDataRaw
+// ---> GetImageDataIntoVectorRaw
Program: gdcm
Module: $RCSfile: gdcmPixelConvert.h,v $
Language: C++
- Date: $Date: 2004/10/12 09:59:45 $
- Version: $Revision: 1.7 $
+ Date: $Date: 2004/10/13 14:15:30 $
+ Version: $Revision: 1.8 $
Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
l'Image). All rights reserved. See Doc/License.txt or
int PixelSize;
bool PixelSign;
int SwapCode;
+
bool IsUncompressed;
bool IsJPEG2000;
bool IsJPEGLossless;
bool IsRLELossless;
+
RLEFramesInfo* RLEInfo;
JPEGFragmentsInfo* JPEGInfo;
-
+
+ // For handling color stage
+ int PlanarConfiguration;
+ bool IsMonochrome;
+ bool IsPaletteColor;
+ bool IsYBRFull;
+
private:
bool ReadAndUncompressRLEFragment(
uint8_t* decodedZone,
void SetJPEGInfo( JPEGFragmentsInfo* inJPEGFragmentsInfo )
{ JPEGInfo = inJPEGFragmentsInfo; }
+ void SetPlanarConfiguration( size_t planarConfiguration )
+ { PlanarConfiguration = planarConfiguration; }
+ void SetIsMonochrome( bool isMonochrome ) { IsMonochrome = isMonochrome; }
+ void SetIsPaletteColor( bool isPaletteColor )
+ { IsPaletteColor = isPaletteColor; }
+ void SetIsYBRFull( bool isYBRFull ) { IsYBRFull = isYBRFull; }
+
uint8_t* GetRGB() { return RGB; }
void SetRGBSize( size_t size ) { RGBSize = size; }
size_t GetRGBSize() { return RGBSize; }
int NumberOfFrames,
uint8_t* fixMemUncompressed );
void ComputeDecompressedImageDataSize();
- void Decompress12BitsTo16Bits(
+ void ReadAndDecompress12BitsTo16Bits(
uint8_t* pixelZone,
FILE* filePtr) throw ( FormatError );
bool ReadAndDecompressRLEFile( void* image_buffer, FILE* fp );
bool ReadAndDecompressJPEGFile( uint8_t* destination, FILE* fp );
void SwapZone( uint8_t* im );
-public:
void ReorderEndianity( uint8_t* pixelZone );
bool ReArrangeBits( uint8_t* pixelZone ) throw ( FormatError );
- void ConvertRGBPlanesToRGBPixels(
- uint8_t* destination,
- size_t imageDataSize );
- void ConvertYcBcRPlanesToRGBPixels(
- uint8_t* destination,
- size_t imageDataSize );
- bool ReadAndDecompressPixelData( void* destination, FILE* fp );
+ void ConvertRGBPlanesToRGBPixels( uint8_t* destination );
+ void ConvertYcBcRPlanesToRGBPixels( uint8_t* destination );
+public:
+ bool ReadAndDecompressPixelData( void* destination, FILE* fp );
+ bool HandleColor( uint8_t* destination );
void Squeeze();
};
} // end namespace gdcm