[Insight-users] Convert dicom image to other format

Luis Ibanez luis.ibanez at kitware.com
Tue Jun 22 19:41:31 EDT 2004


Hi Frank,

You may want to try loading the resulting
MetaImage in the ImageViewer application from

     InsightApplications/
                   ImageViewer

or in ParaView

    http://www.paraview.org

ParaView can read MetaImages directly.

VolView also supports loading signed and
unsigned data, but given that you are loading
the RAW file, you must make sure that you
specify the correct pixel type in the
file open dialog.


   Regards,



     Luis


--------------------
Frank Zhao wrote:
> 
> Yes it is related to signed, unsigned problem. Snap seems can not show 
> image with negative pixel value correctly. The mhd header specify the 
> image type is short, but on screen there is a lot of pixel value more 
> than 60000. so the image looks like a binary image.
> 
> Thanks
> 
> Frank
> 
> 
>> From: Luis Ibanez <luis.ibanez at kitware.com>
>> To: Frank Zhao <zhaofrank at hotmail.com>
>> CC: insight-users at itk.org
>> Subject: Re: [Insight-users] Convert dicom image to other format
>> Date: Tue, 22 Jun 2004 16:11:06 -0400
>>
>>
>> Hi Frank,
>>
>> You probably have some "unsigned short" pixel type on the way.
>>
>>
>> the range of "signed short" is
>>
>>           -32768   to   32765
>>
>>
>>
>> If you can see a pixel at value 60,000 that means that you
>> have accidentally converted the data to "unsigned short"
>> where the range is
>>
>>               0    to  65535
>>
>> In that case the image will look like binary because all the
>> values from 32676 to 65535 are those that should have been
>> in the range from -32768 to -1.
>>
>>
>> Please post the MetaImage header (just the text file .mhd).
>> It may have a pixel type such as MET_USHORT (where "U" stands
>> for unsigned. For a signed type, it should be MET_SHORT.
>>
>>
>>
>>    Regards,
>>
>>
>>        Luis
>>
>>
>>
>> -------------------
>> Frank Zhao wrote:
>>
>>>
>>> The volume type is:
>>>
>>>  typedef signed short   PixelType;
>>>  typedef itk::Image< PixelType, 3 >                VolumeType;
>>>
>>> The DICOM files is CT image data.
>>>
>>> I use both snap and volview to view the result MetaImage file.
>>>
>>> Accurely, it is not corrupted, it still show as a 3D image, but like 
>>> a biany image of the original one, I check the voxel value, it is not 
>>> biniary image. with some voxel value goes up to 60000 and some only 
>>> around 50, look like a bianary image.
>>>
>>> I modified the ISIS demo source for DICOM files( project name: 
>>> APPLICATIONMODEL, following the cvs download provided by you), it 
>>> displays DICOM image correctly, I only  add the writer code after 
>>> DICOM image is loaded.
>>>
>>> When DICOM is readed, it uses signed short as the image type.
>>>
>>> Thank you Luis
>>>
>>> Frank
>>>
>>>> From: Luis Ibanez <luis.ibanez at kitware.com>
>>>> To: Frank Zhao <zhaofrank at hotmail.com>
>>>> CC: insight-users at itk.org
>>>> Subject: Re: [Insight-users] Convert dicom image to other format
>>>> Date: Tue, 22 Jun 2004 14:18:49 -0400
>>>>
>>>>
>>>> Hi Frank,
>>>>
>>>> What is the type:
>>>>
>>>>         "VolumeType"   ?
>>>>
>>>> What is the image modality contained in the
>>>> DICOM files ? (CT, MRI, PET )?
>>>>
>>>> What are you using for viewing the resulting
>>>> MetaImage file ? (and concluding that it is
>>>> corrupted ?).
>>>>
>>>>
>>>> It is very likely that you are using an
>>>> inappropriate pixel type for reading your
>>>> DICOM images.
>>>>
>>>> For example, trying to read 16 bits into an
>>>> image type of 8 bits...
>>>>
>>>>
>>>>
>>>> Regards,
>>>>
>>>>
>>>>    Luis
>>>>
>>>>
>>>> --------------------
>>>> Frank Zhao wrote:
>>>>
>>>>>
>>>>>  After I load 3d Dicom image series, it displays correctly. The 
>>>>> image is corrupted when I using following code to convert it into 
>>>>> another format. But it convert correctly when I load a 3D gipl file.
>>>>>
>>>>> What is the reason?
>>>>>
>>>>> Thank you
>>>>>
>>>>> Frank
>>>>>
>>>>> =========================================
>>>>>  typedef itk::ImageFileWriter< VolumeType > WriterType;
>>>>>  WriterType::Pointer writer = WriterType::New();
>>>>>  writer->SetFileName( "c:\\temp\\test_write.mhd" );
>>>>>  writer->SetInput( m_Reader->GetOutput() );
>>>>>  writer->Update();
>>>>>
>>>>> _________________________________________________________________
>>>>> Is your PC infected? Get a FREE online computer virus scan from 
>>>>> McAfee?Security. 
>>>>> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>>>>>
>>>>> _______________________________________________
>>>>> Insight-users mailing list
>>>>> Insight-users at itk.org
>>>>> http://www.itk.org/mailman/listinfo/insight-users
>>>>>
>>>>
>>>>
>>>>
>>>
>>> _________________________________________________________________
>>> Is your PC infected? Get a FREE online computer virus scan from 
>>> McAfee?Security. 
>>> http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
>>>
>>> _______________________________________________
>>> Insight-users mailing list
>>> Insight-users at itk.org
>>> http://www.itk.org/mailman/listinfo/insight-users
>>>
>>
>>
>>
> 
> _________________________________________________________________
> Is your PC infected? Get a FREE online computer virus scan from McAfee® 
> Security. http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 





More information about the Insight-users mailing list