[Insight-users] Re: applying filters on raw files

Luis Ibanez luis.ibanez@kitware.com
Sun, 16 Mar 2003 11:26:55 -0500


Hi Neha,


Unfortunately not all applications in the InsightApplications
module are taking full advantage of the factory mechanism.

For example, GaussianFilter was restricted to use MetaImage.
In recent weeks, there has been an explosion of new file
formats in the toolkit. So, we have to revisit the applications
and make sure they are taking advantage of the new possibilities.

The GaussianFilter application has been modified now to accept
any of the default file formats registered in the factory
mechanism.

Please try your image with the "MetaImageViewer", this viewer
should be able to read (in addition to MetaImage), any of the
default file formats.  Note that this application will display
a window and requires you to click on the window in order to
force a first refresh. Your file should work ok in this viewer.

Note that RAW is *not* a default format. The reason is that it
is actually not a format at all. In order to read RAW files you
have to hardcode the parameters of the file. That practice defeats
the whole purpose of the flexibility provided by the IO factory
mechanism.


Please let us know if you find any problems,


Thanks


    Luis



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

shilpa kinkar wrote:
> Hi Luis,
> 
> I changed header value ElementType = MET_USHORT, but still it does not 
> work. I tested it again my saving the header file with above value. 
> Well, I guess, I am doing some silly mistake while giving inputs.
> 
> Can you pls. tell me if the filters in application are intended to 
> aupport all 6 file formats supported by ITK currently ? I tried 
> GradientFilter and discrete Gaussian filter, but they are not working. 
> GradientMagnitudeImageFilter application uses oly PNGImageIO object.
> 
> So, how do I proceed to apply filters on raw files ? ( currently, I am 
> converting raw files to PNG format and then apply filter to it.
> 
> Thanks,
> 
> neha
> 
> Thanks a lot.
> 
> Neha
> 
>  */Luis Ibanez <luis.ibanez@kitware.com>/* wrote:
> 
> 
>     Hi Neha,
> 
>     Thanks for sending the header file of you metaimage.
> 
>     The problem is that the RAW file that you are providing is
>     using 16 bits (unsigned short) while your header is saying
>     that it contains 8bits (unsigned char).
> 
>     By changing this in the header I can load your image.
> 
>     Note that the image is encoded in 16bits but the actual
>     content is not filling the dynamic range, so the image
>     appears quite dark when you loaded in a viewer.
> 
> 
>     Here is the content of the correct header:
> 
>     -------- begin of header ------------
> 
>     NDims = 2
>     DimSize = 512 512
>     ElementSpacing = 0.7 0.585
>     Position = 0 0
>     ElementByteOrderMSB = True
>     ElementType = MET_USHORT
>     HeaderSize = -1
>     ElementDataFile = pp37.raw
> 
>     ---------- end of header ------------
> 
> 
>     Regards,
> 
> 
>     Luis
> 
> 
>     -----------------------------------
> 
>     shilpa kinkar wrote:
>      > Hi Luis,
>      >
>      > I have attached the header file as well as data file which I need to
>      > work on. Now, I have tested InsightApplication/RawImageReadWrite
>     and it
>      > works fine with Data provided by Insight. (
>      > Examples\Data\ResampleImageFilterInput2x3b.RAW )
>      >
>      > Since this application is working excellent with my image data (
>      > pp37.raw ), now I don't need to use MetaImageReader.
>      >
>      > Now, what I want to do is, apply Guassian Filter on raw file. I
>     could
>      > successfully test the DiscreteFuassian Filter on PNG file , ( I
>     used the
>      > same program which i was using with Insight 1.0.0 but this time used
>      > Insight 1.2.0 Binaries and it worked fine for PNG files ) BUT
>     ...NOT on
>      > raw file. I think, Filters do not create objects for RAW files ?
>     Can you
>      > tell me what I should do to apply filter on RAW images ?
>      >
>      > Thanks,
>      >
>      > Neha!
>      >
> 
>      >
>      > NDims = 2
>      > DimSize = 512 512
>      > ElementSpacing = 0.7 0.585
>      > Position = 0 0
>      > ElementByteOrderMSB = True
>      > ElementType = MET_UCHAR
>      > HeaderSize = -1
>      > ElementDataFile = pp37.raw
> 
> 
> 
> 
> ------------------------------------------------------------------------
> Do you Yahoo!?
> Yahoo! Web Hosting 
> <http://rd.yahoo.com/webhosting/mail_tagline/evt=7748/*http://webhosting.yahoo.com/ps/wh3/prod/> 
> - establish your business online