[Insight-users] Writting DICOM Images

Mathieu Malaterre mathieu.malaterre at kitware.com
Wed May 18 11:42:31 EDT 2005


Rodolfo,

	Ok this is really a problem. Your DICOM file does not even have 
dimensions. But this is clearly specify in itkGDCMImageIO(*)

	Could you tell me which ITK version are you using. In particular the 
revision at the top of file itkGDCMImageIO.cxx

                    ...
                    Version:   $Revision: 1.74 $
                    ...

Thanks
Mathieu
(*)
   // Handle the dimension of image:
   itksys_ios::ostringstream str;
   str << m_Dimensions[0];
   header->InsertValEntry( str.str(), 0x0028,0x0011); // Columns

   str.str("");
   str << m_Dimensions[1];
   header->InsertValEntry( str.str(), 0x0028,0x0010); // Rows

   if(m_Dimensions[2]>1)
   {
      str.str("");
      str << m_Dimensions[2];
      //header->Insert(str.str(),0x0028,0x0012); // Planes
      header->InsertValEntry(str.str(),0x0028,0x0008); // Number of Frames
   }



Rodolfo Palacios wrote:
> Hello Mathieu...
> 
> When I wrote "The program crashes" I meant the program I'm writting. It 
> just crashes after trying to read one of the slices written before. An 
> error message pops with "Access violation at address xxxxxx". It crashes 
> when trying to execute fp->read(...) in gdcmPixelConvert.cxx
> 
> //////////////////////////////////////////////////
>   //// Second stage: read from disk dans decompress.
>   if ( BitsAllocated == 12 )
>   {
>      ReadAndDecompress12BitsTo16Bits( fp);
>   }
>   else if ( IsDecompressed )
>   {
>      fp->read( (char*)Decompressed, PixelDataLength);       //program 
> crashes here
>      if ( fp->fail() || fp->eof())//Fp->gcount() == 1
>      {
>         dbg.Verbose( 0, "PixelConvert::ReadAndDecompressPixelData: "
>                         "reading of decompressed pixel data failed." );
>         return false;
>      }
>   }
> 
> I'm attaching one of the slices that is causing problems.
> 
> Thank you.
> Rodolfo Palacios.
> 
> 
> 
>> From: Mathieu Malaterre <mathieu.malaterre at kitware.com>
>> To: Rodolfo Palacios <rpalacios75 at hotmail.com>
>> CC: insight-users at itk.org
>> Subject: Re: [Insight-users] Writting DICOM Images
>> Date: Wed, 18 May 2005 08:58:16 -0400
>>
>>
>>> The problem is that I can't read the images I wrote using the process 
>>> described above (the program crashes). VolView can open the images 
>>> but still a vtkOutputWindow opens telling me that some required 
>>> elements are missing (vtkDICOMCollector).
>>
>>
>> Rodolfo,
>>
>>     Which program are you refereing to when you say 'the program 
>> crashes' ? Did you wrote it yourself ? I believe gdcm is able to 
>> reread its own DICOM file without any problem.
>>
>>     The DICOM file written by gdcm where successfully read by efilm 
>> and some philips PACS systems. Is there any chance that you could send 
>> me one slice that's causing the problem ?
>>
>> Thanks for your time,
>> Mathieu
> 
> 



More information about the Insight-users mailing list