[Insight-users] Other image file formats supported by ITK

Luis Ibanez luis . ibanez at kitware . com
Tue, 09 Dec 2003 15:32:36 -0500


Hi Mark,

A larger description of the image file formats supported
by ITK is available at

     http://www . itk . org/HTML/Data . htm

and the FAQ entry

http://www . itk . org/cgi-bin/InsightFAQ/InsightFAQ?req=show&file=faq01 . 007 . htp

(for more entries on the FAQ you may want to check
http://www . itk . org/cgi-bin/InsightFAQ/  )


Hopefully you will find some of these file formats to be useful.


Regards,


    Luis


------------------------
markw wrote:

>Ah I didn't know about those other medical formats - I'll investigate
>those, I just wanted to write DICOMs out because that was the input form
>- thanks again for your help!
>
>Mark
>
>-----Original Message-----
>From: insight-users-admin at itk . org [mailto:insight-users-admin at itk . org]
>On Behalf Of Luis Ibanez
>Sent: Tuesday, December 09, 2003 2:39 PM
>To: markw
>Cc: insight-users at itk . org
>Subject: Re: [Insight-users] writing out DICOM files instead of png
>
>
>Hi  Mark,
>
>None of the DICOM ImageIO classes in ITK are designed
>for writing dicom files. Both of them are intended for
>reading only .  
>
>You can easily check this out by looking at their
>"CanWriteFile()" methods, which are returning "false"
>in both cases.
>
>Although in principle it is not impossible to write a
>DICOM file, the question is whether this is a desirable
>thing to have or not.  These files are supposed to be the
>ones generated from the DICOM stream taken from the
>image acquisition systems.
>
>Is there any reason why you couldn't use any of the other
>formats supported in ITK ?
>
>for example:. MetaImage, Analyze, GIPL, IPL, VTK... ?
>
>Analyze and MetaImage are probably the most flexible
>formats for medical images.
>
>
>Regards,
>
>
>  Luis
>
>
>------------------------------------------------------------
>markw wrote:
>
>  
>
>>Hi Luis,
>>
>>Thanks for your help with the compilation of ITK, everything works fine
>>now. The example programs are great. I had one remaining question about
>>writing out DICOM files after image processing. The image processing
>>examples seem to read DICOM files without problems, but they cannot
>>write over the original DICOM file or write a new one. I tried using
>>    
>>
>the
>  
>
>>itkDICOMImageIO2.h because it seems it will enable you to write DICOM
>>files out, but I think my implementation is incorrect. I created a
>>    
>>
>small
>  
>
>>image filter program to test it out which is below, the part of
>>importance I suppose is here:
>>
>>typedef itk::DICOMImageIO2 DicomHelp;
>>DicomHelp::Pointer         dicomhelp    = DicomHelp::New();
>>dicomhelp->SetFileName( argv[3] );
>>dicomhelp->Write( caster->GetOutput() );
>>
>>but this seems to do nothing when I execute the program. Can you offer
>>any clues? The full test program is below, thanks for your help,
>>
>>Mark
>>
>>
>>#include "itkImage.h"
>>#include "itkImageFileReader.h"
>>#include "itkImageFileWriter.h"
>>
>>#include "itkMedianImageFilter.h"
>>#include "itkCastImageFilter.h"
>>
>>// to try and work with dicoms
>>#include "itkDICOMImageIO2.h"
>>
>>
>>int main( int argc, char *argv[] )
>>{
>> if (argc < 3) {
>>	std::cout << "You need to enter the input and output image
>>names." << std::endl;
>>   return 1;
>> }
>>
>> typedef itk::Image< unsigned char, 2 >
>>InputImageType;
>> typedef itk::Image< unsigned char, 2 >
>>OutputImageType;
>> typedef itk::CastImageFilter< InputImageType, OutputImageType >
>>CastFilterType;
>> typedef itk::ImageFileWriter< OutputImageType >
>>WriterType;
>> typedef itk::ImageFileReader< InputImageType >
>>ReaderType;
>>
>> typedef itk::MedianImageFilter<InputImageType, OutputImageType >
>>MedianFilterType;
>> typedef itk::DICOMImageIO2 DicomHelp;
>>
>> DicomHelp::Pointer        dicomhelp    = DicomHelp::New();
>> ReaderType::Pointer       reader       = ReaderType::New();
>> WriterType::Pointer       writer       = WriterType::New();
>> CastFilterType::Pointer   caster       = CastFilterType::New();
>> MedianFilterType::Pointer medianfilter = MedianFilterType::New();
>>
>> 
>> bool b = dicomhelp->CanWriteFile( "test.dcm" );
>>
>> // always returns true for read, false for write..
>> if (b == true)
>>   std::cout << "true" << std::endl;
>> else
>>   std::cout << "false" << std::endl;
>>
>> reader->SetFileName( argv[1] );
>> medianfilter->SetInput( reader->GetOutput() );
>> reader->Update();
>> 
>> writer->SetFileName( argv[2] );
>> caster->SetInput( medianfilter->GetOutput() );
>> writer->SetInput( caster->GetOutput() );
>>
>> writer->Update();
>> 
>> // Can we also write the output to a DICOM file now?
>> // Seems to never want to do this..
>> dicomhelp->SetFileName( argv[3] );
>> dicomhelp->Write( caster->GetOutput() );
>>
>> std::cout << std::endl << "Finished successfully." << std::endl;
>> return 0;
>>}
>>
>>
>>_______________________________________________
>>Insight-users mailing list
>>Insight-users at itk . org
>>http://www . itk . org/mailman/listinfo/insight-users
>>
>> 
>>
>>    
>>
>
>
>
>
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk . org
>http://www . itk . org/mailman/listinfo/insight-users
>
>
>  
>