[Insight-users] Raw images reader

Thibault Varacca thibault.varacca at gmail.com
Fri Apr 26 10:48:19 EDT 2013


Ok the .mhd way to do this worked great.

I have to do 3D segmentation on raw images. I tryed to do this with the
ThresholdImageFilter but all my values are at zero after applying the
filter ...
My Raw images are Float32 3D 128x128x128, here is my code :

import org.itk.simple.ConnectedThresholdImageFilter;
import org.itk.simple.Image;
import org.itk.simple.ImageFileReader;
import org.itk.simple.ImageFileWriter;
import org.itk.simple.VectorUInt32;

public class ImageReader {

    private static String inputFilename = "fdk.xy.mhd";
    private static String outputFilename = "output.mhd";

    public static void main(String[] args) {

        VectorUInt32 seedList = new VectorUInt32(3);
        ImageFileReader reader = new ImageFileReader();
        ImageFileWriter writer = new ImageFileWriter();
        ConnectedThresholdImageFilter filter = new
ConnectedThresholdImageFilter();

        reader.setFileName(inputFilename);
        writer.setFileName(outputFilename);

        Image input = reader.execute();

        /* valeurs de seuil */
        filter.setLower(0.003);
        filter.setUpper(5);
        filter.setReplaceValue((short) 5);

        /* seed points */
        seedList.clear();
        seedList.push_back(100);
        seedList.push_back(16);
        seedList.push_back(46);


        Image output = filter.execute(input);
        writer.execute(output);

    }

Do you know how to make it work?

Thank you !


2013/4/26 Samuel Pichardo <sammeuly at gmail.com>

> Hi
>
> In Python, you could use rather numpy io function
> http://docs.scipy.org/doc/numpy/reference/generated/numpy.fromfile.html
> and convert the arrays to simpleITK with
> *SimpleITK*.*GetImageFromArray*<http://www.nullege.com/codes/search/SimpleITK.GetImageFromArray>
>
> Regards
>
> Sam
>
>
> On 2013-04-26, at 4:59 AM, Thibault Varacca <thibault.varacca at gmail.com>
> wrote:
>
> Dear all,
> I'm looking to load and read raw images with simpleITK but I didn't find
> any RawReader().
> How can i do this?
> Thanks !
>
> --
> Thibault Varacca
> EFREI Promo 2014
> 06 60 53 11 35
>  _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>


-- 
Thibault Varacca
EFREI Promo 2014
06 60 53 11 35
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20130426/6ea9d314/attachment-0001.htm>


More information about the Insight-users mailing list