[Dcmlib] [Fwd: GDCM problems with created dicom]

Mathieu Malaterre mathieu.malaterre at kitware.com
Fri Dec 17 17:37:19 CET 2004


Jean-Pierre Roux wrote:
> Mathieu Malaterre wrote:
> 
>> Bon j'ai aussi virer (0x0000, 0x0000) ...
> 
> 
> Le pb sera de voir si Dicom3Tools passe, maintenant, et si efilm accepte 
> ça.
> As-tu demande a Bill une image qui pete chez lui?

ouch c'etait pas le probleme des champs 0x0002 ...

dcmtk lui dis:

dcdump 88_20_0.0625_1.dcm
you get an error messages that includes the phrase
Assertion `bitsallocated <= bytesinword*8u' failed.

bitsAllocated je sais ce que c'est mais bytesinword c'est quoi ?

Et dans ITK je fais:

  switch (this->GetComponentType())
     {
     case CHAR:
       bitsAllocated = "8"; // Bits Allocated
       bitsStored    = "8"; // Bits Stored
       highBit       = "7"; // High Bit
       // 8bits DICOM cannot be signed
       pixelRep      = "0"; //Pixel Representation
       break;

     case UCHAR:
       bitsAllocated = "8"; // Bits Allocated
       bitsStored    = "8"; // Bits Stored
       highBit       = "7"; // High Bit
       pixelRep      = "0"; //Pixel Representation
       break;

     case SHORT:
       bitsAllocated = "16"; // Bits Allocated
       bitsStored    = "16"; // Bits Stored
       highBit       = "15"; // High Bit
       pixelRep      = "1"; //Pixel Representation
       break;

     case USHORT:
       bitsAllocated = "16"; // Bits Allocated
       bitsStored    = "16"; // Bits Stored
       highBit       = "15"; // High Bit
       pixelRep      = "1"; //Pixel Representation
       break;

     default:
       itkExceptionMacro(<<"DICOM does not support this component type");
     }


En creusant un peu dans google je trouve:

http://groups-beta.google.com/group/comp.protocols.dicom/browse_thread/thread/5393f923405c0ac/1ebfa5cc09cb649f

Je pense que le probleme viens du fait que dans ITK je construit from 
scratch mon image:

h = new gdcmHeader
for i in :
   h.ReplaceOrCreateByNumber( itk_dict[i] )

f = new gdcmFile
f.SetHeader(h)
f.SetImageData( itk_buffer )

f.Write()

Ce qui doit se passer c'est que je copie aveuglement un Transfer Syntax 
qui ne correspond pas a un header d'image DICOM raw...

Mathieu
Ps: vivement que je update gdcm dans ITK...





More information about the Dcmlib mailing list