[Dcmlib] Bug in writing RGB images : Forget previous message
Jean-Pierre Roux
Jean-Pierre.Roux at creatis.insa-lyon.fr
Tue Mar 21 10:23:23 CET 2006
Jean-Pierre Roux wrote:
> Mathieu Malaterre wrote:
>
>> If one do:
>>
>> file->SetWriteModeToRGB()
>> then call
>> file->Write( filename )
>>
>> the file will be refused to be written (function will return false).
>>
>> Fix:
>> Explicitely set the Sample Per Pixel to be 3.
>>
>> header->InsertValEntry("3",0x0028,0x0002); // Samples per Pixel
>
>
>
> In order to free user from such details, I modified
> gdcm::FileHelper:SetWriteMode() method as follow :
Oops !
I just checked it on ... 'true' RGB images.
(It hangs on gray level images :-(
Sorry for the noise.
JP
> void SetWriteMode(FileMode mode) {
> WriteMode = mode;
> // Deal with Samples per Pixel if (mode == WMODE_RGB)
> FileInternal->InsertValEntry("3",0x0028,0x0002);
> }
> (was previously :
> void SetWriteMode(FileMode mode) { WriteMode = mode; }
>
> JP
>
>>
>> HTH,
>> Mathieu
>> _______________________________________________
>> Dcmlib mailing list
>> Dcmlib at creatis.insa-lyon.fr
>> http://www.creatis.insa-lyon.fr/mailman/listinfo/dcmlib
>>
>
>
More information about the Dcmlib
mailing list