<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Thank you Luis for adding the required example. However, how can I do to access this file?<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Shall I download the latest version or is there any fastest method to get this file?<o:p></o:p></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Sorry for my silly question!<o:p></o:p></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Thanks <o:p></o:p></SPAN></DIV>
<DIV><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Arial','sans-serif'">Juliette<o:p></o:p></SPAN></DIV>
<DIV><BR><BR>--- En date de : <B>Mer 21.10.09, Luis Ibanez <I><luis.ibanez@kitware.com></I></B> a écrit :<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>De: Luis Ibanez <luis.ibanez@kitware.com><BR>Objet: Re: [Insight-users] Is there any itk::BoundingBox example?<BR>À: "Juliette Deniau" <juliette.deniau@yahoo.fr><BR>Cc: "insight" <insight-users@itk.org><BR>Date: Mercredi 21 Octobre 2009, 17h32<BR><BR>
<DIV id=yiv882548480><BR>Hi Juliette,<BR><BR><BR>For your convenience,<BR><BR>We just added to ITK an example on how to do this <BR>by using the ImageMaskSpatial object and its method:<BR><BR> GetAxisAlignedBoundingBoxRegion()<BR><BR><BR>This new example is now under the directory:<BR><BR> Insight/Examples/SpatialObjects<BR><BR>The filename is:<BR><BR> BoundingBoxFromImageMaskSpatialObject.cxx<BR><BR>and the essential part of the code is:<BR><BR><BR> typedef itk::ImageMaskSpatialObject<3> ImageMaskSpatialObject;<BR><BR> typedef ImageMaskSpatialObject::ImageType ImageType;<BR> typedef ImageType::RegionType RegionType;<BR> typedef itk::ImageFileReader< ImageType
> ReaderType;<BR><BR> ReaderType::Pointer reader = ReaderType::New();<BR><BR> reader->SetFileName( argv[1] );<BR> reader->Update();<BR><BR> ImageMaskSpatialObject::Pointer maskSO = ImageMaskSpatialObject::New();<BR><BR> maskSO->SetImage ( reader->GetOutput() );<BR><BR> RegionType boundingBoxRegion = maskSO->GetAxisAlignedBoundingBoxRegion();<BR><BR> std::cout << "Bounding Box Region: " << boundingBoxRegion << std::endl;<BR><BR><BR>Here we assume that you are reading a binary image.<BR><BR>Note that the bounding box is actually stored in an<BR>itk::Region<3> class, instead of an itk::BoundingBox<BR>class.<BR><BR>The main difference between these two classes is that the<BR>Region represents pixels (discrete positions on the image <BR>grid), while the itk::BoundingBox represents physical <BR>coordinates in Space.<BR><BR><BR>Another option that you
may want to consider is the use <BR>of the LabelMap classes contributed by Gaetan Lehmann.<BR><BR> <A href="http://www.insight-journal.org/browse/publication/176" target=_blank rel=nofollow>http://www.insight-journal.org/browse/publication/176</A><BR><BR>These classes are now in the directory:<BR><BR> Insight/Code/Review<BR><BR>In particular the <BR><BR> itkAutoCropLabelMapFilter.h<BR><BR>will do both:<BR><BR> * Computing the bounding box<BR> * Extracting that region from the image.<BR><BR>These family of classes will also compute features<BR>such as the center of gravity, if you actually need<BR>such values as well.<BR><BR><BR> Regards,<BR><BR><BR> Luis<BR><BR><BR>-------------------------------------------------------------------------------------<BR>
<DIV class=gmail_quote>On Mon, Oct 19, 2009 at 6:48 AM, Juliette Deniau <SPAN dir=ltr><<A href="http://fr.mc282.mail.yahoo.com/mc/compose?to=juliette.deniau@yahoo.fr" target=_blank rel=nofollow ymailto="mailto:juliette.deniau@yahoo.fr">juliette.deniau@yahoo.fr</A>></SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD style="FONT-FAMILY: inherit; font-size-adjust: inherit; font-stretch: inherit" vAlign=top>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Hi,</FONT> </DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT size=3><FONT face=Calibri>I would like to get the bounding box of a segmented object .<SPAN> </SPAN><SPAN style="COLOR: black">Currently I’m doing that by computing the min, max, and the center of gravity of the object . I would like to do it using the already itk class </SPAN>itk::<SPAN style="COLOR: black"> </SPAN></FONT></FONT><A title="Represent and compute information about bounding boxes." href="http://www.itk.org/Doxygen316/html/classitk_1_1BoundingBox.html" target=_blank rel=nofollow><SPAN style="COLOR: windowtext; TEXT-DECORATION: none"><FONT face=Calibri size=3>BoundingBox</FONT></SPAN></A><FONT size=3><FONT face=Calibri>, <SPAN> </SPAN>however<SPAN style="COLOR: black"> I don’t know how? Any help is appreciated. </SPAN></FONT></FONT></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="COLOR: black"><FONT size=3><FONT face=Calibri>Thanks</FONT></FONT></SPAN> </DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Juliette</FONT></DIV></TD></TR></TBODY></TABLE><FONT color=#888888><BR></FONT><BR>_____________________________________<BR>Powered by <A href="http://www.kitware.com/" target=_blank rel=nofollow>www.kitware.com</A><BR><BR>Visit other Kitware open-source projects at<BR><A href="http://www.kitware.com/opensource/opensource.html" target=_blank rel=nofollow>http://www.kitware.com/opensource/opensource.html</A><BR><BR>Please keep messages on-topic and check the ITK FAQ at: <A href="http://www.itk.org/Wiki/ITK_FAQ" target=_blank rel=nofollow>http://www.itk.org/Wiki/ITK_FAQ</A><BR><BR>Follow this link to subscribe/unsubscribe:<BR><A href="http://www.itk.org/mailman/listinfo/insight-users" target=_blank rel=nofollow>http://www.itk.org/mailman/listinfo/insight-users</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE></td></tr></table><br>