<div dir="ltr"><div><div><div><div>Hello Sidharta,<br><br></div>Don't forget to move the ellipsoid where you want in space. In the example that Robert pointed you to [1], it is:<br><br><pre class="gmail-de1">ellipse<span class="gmail-sy2">-</span><span class="gmail-sy1">></span>SetObjectToParentTransform<span class="gmail-br0">(</span> transform <span class="gmail-br0">)</span><span class="gmail-sy4">;</span></pre>To obtain only haft a dome, you could only create an image that contains half of your ellipse for "<wbr>SpatialObjectToImageFilter", and then resize the image<br></div>afterward to match the image size you want.<br><br></div>Hope this helps,<br></div>Francois<br><div><div><div><div><br><br>[1] <a href="https://itk.org/Wiki/ITK/Examples/SpatialObjects/EllipseSpatialObject">https://itk.org/Wiki/ITK/Examples/SpatialObjects/EllipseSpatialObject</a><br></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, May 10, 2017 at 8:06 AM, sidharta <span dir="ltr"><<a href="mailto:sidharta.gupta93@gmail.com" target="_blank">sidharta.gupta93@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I tried the EllipseSpatialObject as follows:<br>
<br>
int EllipseSpatialObjectToImage(<wbr>InputImageType::Pointer binaryImage){<br>
<br>
typedef itk::EllipseSpatialObject<<wbr>Dimension> EllipseType;<br>
EllipseType::Pointer ellipse = EllipseType::New();<br>
<br>
ellipse->SetRadius(0.5 / binaryImage->GetSpacing()[0]);<br>
ellipse-><wbr>SetDefaultInsideValue(1.0);<br>
ellipse-><wbr>SetDefaultOutsideValue(0.0);<br>
<br>
typedef itk::<wbr>SpatialObjectToImageFilter<<wbr>EllipseType, InputImageType><br>
SpatialObjectToImageFilterType<wbr>;<br>
SpatialObjectToImageFilterType<wbr>::Pointer filter =<br>
SpatialObjectToImageFilterType<wbr>::New();<br>
<br>
int d = 1.0 / binaryImage->GetSpacing()[0];<br>
InputImageType::SizeType size;<br>
size.Fill(d);<br>
filter->SetSize(size);<br>
<br>
filter->SetInsideValue(255);<br>
filter->SetOutsideValue(0);<br>
<br>
double O[3] = { 0, 0, 0 };<br>
filter->SetOrigin(O);<br>
filter->SetInput(ellipse);<br>
<br>
filter->Update();<br>
<br>
int flag = FileWriter(filter->GetOutput()<wbr>,<br>
"C:/Users/api/Desktop/3D_mask_<wbr>ellipse.mhd");<br>
if (!flag)<br>
return EXIT_FAILURE;<br>
else<br>
return EXIT_SUCCESS;<br>
}<br>
But I get a blank image unfortunately. How would I get hemi-sphere from<br>
this? Just cropImageFilter?<br>
<br>
<br>
Thank you<br>
Sidharta<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://itk-users.7.n7.nabble.com/Creating-3D-dome-using-ITK-tp38201p38210.html" rel="noreferrer" target="_blank">http://itk-users.7.n7.nabble.<wbr>com/Creating-3D-dome-using-<wbr>ITK-tp38201p38210.html</a><br>
<div class="HOEnZb"><div class="h5">Sent from the ITK - Users mailing list archive at Nabble.com.<br>
______________________________<wbr>_______<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank">http://www.itk.org/Wiki/ITK_<wbr>FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/insight-users</a><br>
</div></div></blockquote></div><br></div>