[Insight-developers] Insight Journal paper "A Label Geometry Image Filter for Multiple Object Measurement" moved to Review
Bill Lorensen
bill.lorensen at gmail.com
Mon Dec 14 17:24:50 EST 2009
I think Luis was questioning using a switch to change behavior.
Usually this is not a very object-oriented way. A different method for
each is more desirable. However, it there would be too much
duplication of code and there is not a way to refactor the code into
smaller pieces, a switch might be the preferred approach.
Bill
On Mon, Dec 14, 2009 at 5:02 PM, Padfield, Dirk R (GE, Research)
<padfield at research.ge.com> wrote:
> Hello Luis,
>
> Thank you for working on this and for your questions. Here are my answers.
>
> The purpose of the "CalculateOrientedBoundingBoxVertices" method is to calculate the oriented bounding boxes. To accomplish this, it transforms all of the "on" pixels of a labeled object (specified by m_PixelIndices) into the space aligned with the eigenvectors using a matrix multiplication with the rotation matrix. It calculates the bounding boxes in that space and then transforms the coordinates back to the original space. Thus, for this step, it doesn't require the resampling of the image.
>
> However, the "CalculateOrientedImage" method does the actual rotation of the labeled objects. This is useful if the user wants to align all of the objects, for example as an input to PCA.
>
> The reason "CalculateOrientedImage" has a boolean that switches the behavior is to give the user the ability to rotate *either* the intensity regions *or* the masked regions. If this extra generalization of the code introduces too much complexity, we could break that code into two methods like "CalculatedOrientedIntensityImage" and "CalculateOrientedMaskImage". Since most of the code is common for these two operations, we instead introduced the boolean. What do you think?
>
> Also, since the calling of these methods depends on flags by the user, they are only run if the user requests them.
>
> Please let me know if this makes sense and if you have further questions.
>
> Thanks,
> Dirk.
>
>
>
> -----Original Message-----
> From: Luis Ibanez [mailto:luis.ibanez at kitware.com]
> Sent: Wednesday, December 09, 2009 11:19 AM
> To: Padfield, Dirk R (GE, Research); Miller, James V (GE, Research)
> Cc: Insight Developers
> Subject: Re: Insight Journal paper "A Label Geometry Image Filter for Multiple Object Measurement" moved to Review
>
> Dirk, Jim,
>
> Today's Dashboard is showing the usual quirks with the Sun and Visual studio 6.0 compilers.
>
> The issue with VS6.0 requires some discussion:
> http://www.cdash.org/CDash/viewBuildError.php?buildid=489238
>
> Lines: 496-501
> declare a templated method inside a templated class, but the type of the template is not part of the arguments in the method signature:
>
>
> template<class TLabelImage, class TIntensityImage> template<class TGenericImage> bool LabelGeometryImageFilter<TLabelImage, TIntensityImage> ::CalculateOrientedImage(vnl_symmetric_eigensystem<double> eig, LabelGeometry & labelGeometry, bool useLabelImage) {
>
>
>
> Our typical solution to this problem is to make the template argument type to be one of the arguments of the function or method.
>
>
> However, the overall design of this method is strange, since in addition to the template argument, it also includes a boolean that will switch the method from one behavior to another.
>
>
> Now... I am probably missing something here...
> but at first sight,
> having to rotate (by resampling) an image in order to compute the rotated bounding box, sounds like a very inefficient (and unnecessary) way of arriving to such computation.
>
>
> Could you please elaborate on the rationale for performing this computation via this route ?
>
>
> We certainly would like to take care of this
> compilation error in VS6.0 today.
>
>
>
> Thanks,
>
>
> Luis
>
>
> --------------------------------------------------------------------------------
> On Tue, Dec 8, 2009 at 7:57 AM, Luis Ibanez <luis.ibanez at kitware.com> wrote:
>> Dirk, Jim,
>>
>>
>> In preparation for the ITK 3.18 release,
>>
>>
>> Your paper:
>>
>> "A Label Geometry Image Filter for Multiple Object Measurement"
>> http://www.insight-journal.org/browse/publication/301
>> http://hdl.handle.net/1926/1493
>>
>>
>> has been moved into the directory
>>
>> Insight/Code/Review
>>
>>
>> A) Many coding style changes were made to the
>> source code in the Insight Journal.
>>
>> B) Only the 2D test has been incorporated.
>>
>> The image provided in the IJ paper for
>> the 3D test is a bit too large for ITK standards.
>>
>> Could you suggest a smaller image to use ?
>>
>> Ideally one that is already in Testing/Data/Input :-)
>>
>>
>> C) The Code Review is not yet complete,
>> we are still going through the list of items
>> in the Check List
>>
>> http://www.itk.org/Wiki/ITK_Code_Review_Check_List
>>
>>
>> In the meantime, we anticipate the usual tweaking with different
>> platforms (Borland, Cygwin, Sun CC...).
>> We will take care of it in the following days.
>>
>>
>> Thanks
>>
>>
>> Luis
>>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.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-developers
>
More information about the Insight-developers
mailing list