<html><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }div.foxdiv20160707170845260230 { word-wrap: break-word; -webkit-line-break: after-white-space; }body { font-size: 10.5pt; font-family: 'Segoe UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>Hi, Bradley</div><div><br></div><div>Thank you ! But how can i fill it with metadata information?</div><div>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?</div><div><br></div><div>One function i found is CopyInformation(), however it requires Given input image has to be as same dimension as output one.</div><div>What i want is followings: </div><div>1.First read dicoms volume data (CTs) from a folder recursively using SeriesReader</div><div>2. then convert all 3d volumes into my own data structure, then serialize it into bytes and passed to some remote server.</div><div>consider 1-2 steps are data import steps.</div><div>when exporting the data from remote server, i do :</div><div>3.read the bytes and deserialize bytes into self-defined image data structure.</div><div>4.convert data structure into itk image(3d)</div><div>remember when i do import, i actually extract all dicom tags i needed and put finally into data structure. </div><div>So the question is how can i use Simpleitk java to read self-defined structure to recontruct dicom images including pixel data and metadata.</div><div><span style="font-size: 10.5pt; line-height: 1.5; background-color: window;"> </span></div><div>Best Regards,</div><div>Tom    </div>
<div><br></div><hr style="width: 210px; height: 1px;" color="#b5c4df" size="1" align="left">
<div><span><div style="MARGIN: 10px; FONT-FAMILY: verdana; FONT-SIZE: 10pt"><div>weiehome@sina.com</div></div></span></div>
<blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div> </div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm"><div style="PADDING-RIGHT: 8px; PADDING-LEFT: 8px; FONT-SIZE: 12px;FONT-FAMILY:tahoma;COLOR:#000000; BACKGROUND: #efefef; PADDING-BOTTOM: 8px; PADDING-TOP: 8px"><div><b>From:</b> <a href="mailto:blowekamp@mail.nih.gov">Lowekamp, Bradley (NIH/NLM/LHC) [C]</a></div><div><b>Date:</b> 2016-07-06 21:00</div><div><b>To:</b> <a href="mailto:weiehome@sina.com">weiehome@sina.com</a></div><div><b>CC:</b> <a href="mailto:community@itk.org">community@itk.org</a></div><div><b>Subject:</b> Re: [ITK] question regarding simpleitk java wrapper</div></div></div><div><div class="FoxDiv20160707170845260230">
Hello,
<div class=""><br class="">
</div>
<div class="">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.</div>
<div class=""><br class="">
</div>
<div class="">It would look something like the </div>
<div class=""><br class="">
</div>
<div class="">
<div class="">   Image img2 = new Image( 10, 10, PixelIDValueEnum.sitkInt16 );</div>
<div class=""><br class="">
</div>
<div class="">    VectorDouble origin = new VectorDouble(img2.getDimension());</div>
<div class="">    origin.set( 0, 1.0);</div>
<div class="">    origin.set( 1, 2.0);</div>
<div class="">    img2.setOrigin(origin);</div>
<div class=""><br class="">
</div>
<div class="">    System.out.format("%s", img2.toString());</div>
</div>
<div class=""><br class="">
</div>
<div class="">HTH,</div>
<div class="">Brad</div>
<div class=""><br class="">
</div>
<div class="">[1] <a href="https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1Image.html" class="">https://itk.org/SimpleITKDoxygen/html/classitk_1_1simple_1_1Image.html</a></div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="" style="margin-top: 0px;">
<div class="">On Jul 6, 2016, at 5:25 AM, <a href="mailto:weiehome@sina.com" class="">
weiehome@sina.com</a> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span class=""></span>Hi, </div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<br class="">
</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
Is there a possible way i can create an itk image in java just like in c++ :</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<br class="">
</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
Image itkImage = new Image();</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
itkImage.setOrgin( ... );</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
itkImage.setSpacing( ... );</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
itkImage.setRegion( ... );</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
itkImage.fill(0);</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<br class="">
</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
It seems in java i can get itk Image object either by reading files or from filters?</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span segoeui??;font-size:14px;color:rgb(0,0,0);background-color:rgba(0,font-weight:normal;font-style:normal;text-decoration:none;?="" style="font-family: '} ';" class=""></span><br class="">
</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
Regards, Tommi</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<br class="">
</div>
<div style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span segoeui??;font-size:14px;color:rgb(0,0,0);background-color:rgba(0,font-weight:normal;font-style:normal;text-decoration:none;?="" style="font-family: '} ';" class=""><br class="">
</span></div>
<span style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<span style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Community
 mailing list</span><br style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="mailto:Community@itk.org" style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">Community@itk.org</a><br style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">
<a href="http://public.kitware.com/mailman/listinfo/community" style="font-family: 'Segoe UI'; font-size: 14px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://public.kitware.com/mailman/listinfo/community</a></div>
</blockquote>
</div>
<br class="">
</div>
</div></div></blockquote>
</body></html>