[ITK] question regarding simpleitk java wrapper

Lowekamp, Bradley (NIH/NLM/LHC) [C] blowekamp at mail.nih.gov
Wed Jul 6 09:00:03 EDT 2016


Hello,

You can create it in a similar way to C++. The constructor does have required arguments to specify its size and pixel type.. You need to look at the Doxygen for the API documentation [1]. Also the SimpleITK Image will automatically allocated and initialized the data to 0 unlike an ITK image.

It would look something like the

   Image img2 = new Image( 10, 10, PixelIDValueEnum.sitkInt16 );

    VectorDouble origin = new VectorDouble(img2.getDimension());
    origin.set( 0, 1.0);
    origin.set( 1, 2.0);
    img2.setOrigin(origin);

    System.out.format("%s", img2.toString());

HTH,
Brad

[1] https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1Image.html

On Jul 6, 2016, at 5:25 AM, weiehome at sina.com<mailto:weiehome at sina.com> wrote:

Hi,

Is there a possible way i can create an itk image in java just like in c++ :

Image itkImage = new Image();
itkImage.setOrgin( ... );
itkImage.setSpacing( ... );
itkImage.setRegion( ... );
itkImage.fill(0);

It seems in java i can get itk Image object either by reading files or from filters?

Regards, Tommi


_______________________________________________
Community mailing list
Community at itk.org<mailto:Community at itk.org>
http://public.kitware.com/mailman/listinfo/community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160706/c28cae3f/attachment.html>


More information about the Community mailing list