[Insight-users] Is there any itk::BoundingBox example?

Luis Ibanez luis.ibanez at kitware.com
Mon Oct 26 12:53:44 EDT 2009


Hi Juliette,

Here are three options for you to get the file
of this new example:

A)  Do a CVS checkout of ITK
     http://www.itk.org/ITK/resources/software.html

or


B)  Get the file through the Web CVS interface:
http://public.kitware.com/cgi-bin/viewcvs.cgi/Examples/SpatialObjects/BoundingBoxFromImageMaskSpatialObject.cxx?root=Insight&sortby=date&sortdir=down&view=log
you could use this direct link:
http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Examples/SpatialObjects/BoundingBoxFromImageMaskSpatialObject.cxx?revision=1.1&root=Insight


or


C) Get it as the attachment of this email     :-)



     Regards,


              Luis



-------------------------------------
On Mon, Oct 26, 2009 at 12:25 PM, Juliette Deniau
<juliette.deniau at yahoo.fr>wrote:

> Thank you Luis for adding the required example. However, how can I do to
> access this file?
> Shall I download the latest version or is there any fastest method to get
> this file?
> Sorry for my silly question!
> Thanks
> Juliette
>
>
> --- En date de : *Mer 21.10.09, Luis Ibanez <luis.ibanez at kitware.com>* a
> écrit :
>
>
> De: Luis Ibanez <luis.ibanez at kitware.com>
> Objet: Re: [Insight-users] Is there any itk::BoundingBox example?
> À: "Juliette Deniau" <juliette.deniau at yahoo.fr>
> Cc: "insight" <insight-users at itk.org>
> Date: Mercredi 21 Octobre 2009, 17h32
>
>
>
> Hi Juliette,
>
>
> For your convenience,
>
> We just added to ITK an example on how to do this
> by using the ImageMaskSpatial object and its method:
>
>           GetAxisAlignedBoundingBoxRegion()
>
>
> This new example  is now under the directory:
>
>             Insight/Examples/SpatialObjects
>
> The filename is:
>
>    BoundingBoxFromImageMaskSpatialObject.cxx
>
> and the essential part of the code is:
>
>
>  typedef itk::ImageMaskSpatialObject<3>      ImageMaskSpatialObject;
>
>   typedef ImageMaskSpatialObject::ImageType   ImageType;
>   typedef ImageType::RegionType               RegionType;
>   typedef itk::ImageFileReader< ImageType >   ReaderType;
>
>   ReaderType::Pointer reader = ReaderType::New();
>
>   reader->SetFileName( argv[1] );
>   reader->Update();
>
>   ImageMaskSpatialObject::Pointer maskSO = ImageMaskSpatialObject::New();
>
>   maskSO->SetImage ( reader->GetOutput() );
>
>   RegionType boundingBoxRegion  =
> maskSO->GetAxisAlignedBoundingBoxRegion();
>
>   std::cout << "Bounding Box Region: " << boundingBoxRegion << std::endl;
>
>
> Here we assume that you are reading a binary image.
>
> Note  that the bounding box is actually stored in an
> itk::Region<3> class, instead of an itk::BoundingBox
> class.
>
> The main difference between these two classes is that the
> Region represents pixels (discrete positions on the image
> grid), while the itk::BoundingBox represents physical
> coordinates in Space.
>
>
> Another option that you may want to consider is the use
> of the LabelMap classes contributed by Gaetan Lehmann.
>
>   http://www.insight-journal.org/browse/publication/176
>
> These classes are now in the directory:
>
>            Insight/Code/Review
>
> In particular the
>
>           itkAutoCropLabelMapFilter.h
>
> will do both:
>
>   * Computing the bounding box
>   * Extracting that region from the image.
>
> These family of classes will also compute features
> such as the center of gravity, if you actually need
> such values as well.
>
>
>   Regards,
>
>
>         Luis
>
>
>
> -------------------------------------------------------------------------------------
> On Mon, Oct 19, 2009 at 6:48 AM, Juliette Deniau <juliette.deniau at yahoo.fr<http://fr.mc282.mail.yahoo.com/mc/compose?to=juliette.deniau@yahoo.fr>
> > wrote:
>
>>   Hi,
>>
> I would like to get the bounding box of a segmented object .  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 itk::
> BoundingBox<http://www.itk.org/Doxygen316/html/classitk_1_1BoundingBox.html>,
>  however I don’t know how? Any help is appreciated.
>
> Thanks
>
> Juliette
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091026/42e011c3/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BoundingBoxFromImageMaskSpatialObject.cxx
Type: text/x-c++src
Size: 2484 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20091026/42e011c3/attachment-0001.cxx>


More information about the Insight-users mailing list