[Insight-users] getting gibberish inconsistantly

Luis Ibanez luis.ibanez at kitware.com
Mon, 01 Mar 2004 21:32:21 -0500


Hi Sumit,


This is not ITK's fault !   :-)


The "identify" tool of ImageMagick will give you the answer:


 > identify notworkfix.png
 > notworkfix.png PNG 512x512+0+0 DirectClass 16-bit 640.0k 0.040u 0:01

 > identify workfix.png
 > workfix.png PNG 512x512+0+0 DirectClass 8-bit 157.3k 0.020u 0:01



The image that is not working was saved by ImageMagick in 16 bits.


The image that is working was saved by GIMP in 8 bits.


Checking the pixel type of the images is one of your first
responsibilities when you are working in medical data.



Enjoy ITK !


    Luis


-----------------

Sumit Shah wrote:
> Dear ITK users,
> 
> I have been slowly trying to get up-to speed with the ITK api and I am 
> slowly making progress.  Thanks to the development team for such a fine 
> piece of software.  Unfortunately I have been running into a problem 
> that I'm not sure how to fix or even know where to begin.  I have been 
> studying the ImageRegsitration4.cxx example and have run it on two dicom 
> images in my dataset:
> 
> My first step was to use ImageMagick to convert the dicom images to png.
> 
> Then I ran: ImageRegistration4 fix.png mov.png out.png
> 
> The resulting output file was ended up looking like gibberish.
> 
> I then opened fix.png and mov.png in the GIMP and resaved it.  I reran 
> ImageRegistration4 fix.png mov.png out.png and this time out.png looked 
> as expected.
> 
> I have saved the results and placed them on this website if anyone would 
> like to see:
> 
> http://rip.ucla.edu/~shah/itk
> 
> There are six images:
> 
> http://rip.ucla.edu/~shah/itk/notworkfix.png
> http://rip.ucla.edu/~shah/itk/notworkmov.png
> http://rip.ucla.edu/~shah/itk/notworkout.png
> 
> when the output of ImageRegistration4 was gibberish and:
> 
> http://rip.ucla.edu/~shah/itk/workfix.png
> http://rip.ucla.edu/~shah/itk/workmov.png
> http://rip.ucla.edu/~shah/itk/workout.png
> 
> when the output was "right"
> 
> I tried this both on a OSX compiled version of ITK 1.6 and a cygwin 
> compiled version using gcc 3.3 on both platforms.
> 
> 
> Thanks in advance,
> sumit
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>