[Insight-users] image io

Luis Ibanez luis.ibanez at kitware.com
Mon Aug 14 07:36:38 EDT 2006


Hi Ziv,

Thanks for pointing this out.

You are right, the writers should print out a warning in this case.

We added this as a bug entry
http://public.kitware.com/Bug/bug.php?op=show&bugid=3605&pos=0


Note however that for applications that use a GUI, these warning
may not be shown to the user. You will only see them in command
line applications. Therefore, it is still the responsibility of
the application to select/offer/allow users only the fileformat
that are appropriate for the type of images that are being used
in the application.


    Regards,



       Luis



------------------
Ziv Yaniv wrote:
> Hi all,
> After using the itk image IO for a while I have one question and one 
> wish-list request:
> 
> 1. When reading image data is there a way to read data without 
> specifying the pixel type in advance?
>   typedef itk::Image<int,3> ImageType;
>   typedef itk::ImageReader<ImageType> ReaderType;
> 
> The ITK toolkit makes the assumption that I know the pixel type in 
> advance which is not always the case. This primarily happens when I read 
> DICOM images. The toolkit itself loads the data correctly into memory as 
> it knows what the pixel type is after reading the DICOM header. Once the 
> data is read it is cast to the pixel type that I had provided (e.g. int, 
> see above). As I'm not sure what the pixel type is I will usually use 
> the largest possible primitive (double), which is a waste of memory. Is 
> there an elegant way to query the file and then create a correct image 
> type and reader?
> 
> 2. When writing 2D images (jpg/png/bmp) the writers check that the image 
> is 2D and that the pixel type is valid (e.g. unsigned int), what they 
> don't check is that the image is isotropic which is what these image 
> file formats assume. Please add this as an additional condition for 
> successful image writing (took me a while to understand why my extracted 
> slices were so distorted).
> 
>                           best
>                                  Ziv
> 
> P.S. From the itkJPEGImageIO.h (itk 2.8):
> 
>  /** Determine the file type. Returns true if this ImageIO can read the
>   * file specified. */
>  virtual bool CanWriteFile(const char*);
> 
>  Should be "... can write the ...", the joys of cut and paste.
> 
> _______________________________________________
> 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