[ITK] question regarding simpleitk java wrapper
weiehome at sina.com
weiehome at sina.com
Fri Jul 8 02:31:44 EDT 2016
Thanks! Can't wait to see the new release. Set method for metadata is exactly what i want.
weiehome at sina.com
From: Yaniv, Ziv Rafael (NIH/NLM/LHC) [C]
Date: 2016-07-08 00:32
To: weiehome at sina.com; Lowekamp, Bradley (NIH/NLM/LHC) [C]
CC: community at itk.org
Subject: Re: [ITK] question regarding simpleitk java wrapper
Hello Tom,
We are currently working on adding a Set method for data in the metadata dictionary of SimpleITK images. This should be out shortly.
With regard to the second question, "how can i use Simpleitk java to read self-defined structure to recontruct dicom images including pixel data and metadata.” If the image is in your self defined data structure then SimpleITK can’t do a thing, we only work with SimpleITK images. If you have a SimpleITK image object which you filled with intensity data+spacing data + size data + direction data, you will be able to update its meta-data dictionary once we add the Set method for the meta-data dictionary and then you can save it as a DICOM series.
hope this clarified things
Ziv
From: "weiehome at sina.com" <weiehome at sina.com>
Date: Thursday, July 7, 2016 at 5:21 AM
To: "Lowekamp, Bradley (NIH/NLM/LHC) [C]" <blowekamp at mail.nih.gov>
Cc: "community at itk.org" <community at itk.org>
Subject: Re: [ITK] question regarding simpleitk java wrapper
Hi, Bradley
Thank you ! But how can i fill it with metadata information?
In c++, i can set metadatas manually using raw pointer to MetadataDictionary instance to achieve it, but in JAVA, it seems there is no such way of setting Image Metadata?
One function i found is CopyInformation(), however it requires Given input image has to be as same dimension as output one.
What i want is followings:
1.First read dicoms volume data (CTs) from a folder recursively using SeriesReader
2. then convert all 3d volumes into my own data structure, then serialize it into bytes and passed to some remote server.
consider 1-2 steps are data import steps.
when exporting the data from remote server, i do :
3.read the bytes and deserialize bytes into self-defined image data structure.
4.convert data structure into itk image(3d)
remember when i do import, i actually extract all dicom tags i needed and put finally into data structure.
So the question is how can i use Simpleitk java to read self-defined structure to recontruct dicom images including pixel data and metadata.
Best Regards,
Tom
weiehome at sina.com
From: Lowekamp, Bradley (NIH/NLM/LHC) [C]
Date: 2016-07-06 21:00
To: weiehome at sina.com
CC: community at itk.org
Subject: Re: [ITK] question regarding simpleitk java wrapper
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 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
http://public.kitware.com/mailman/listinfo/community
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20160708/6fff3a59/attachment-0001.html>
More information about the Community
mailing list