<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
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="">
<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>
</body>
</html>