[Insight-users] Diagonal Iterator?

Luis Ibanez luis.ibanez at kitware.com
Fri Dec 10 07:39:53 EST 2010


Hi Alberto,

The LineIterator may be what you are looking for.

http://www.itk.org/Doxygen/html/classitk_1_1LineIterator.html

"LineIterator is an iterator that walks a Bresenham line through an
image. The iterator is constructed similar to other image iterators
except for instead of specifying a region to traverse, you specify two
indices. The interval specified by the two indices is closed. So, a
line iterator specified with the same start and end index will visit
exactly one pixel."

ImageType::IndexType I1;
ImageType::IndexType I2;

 LineConstIterator<ImageType> it(image, I1, I2);
 while (!it.IsAtEnd())
 {
    it.Get();
    ++it;
 }


Where I1, I2 are the indexes of
the diagonal line end points.

You may compute these indexes
from the following pseudo-code:

region =  inputImage->GetLargestPossibleRegion();
I1 = region.GetIndex()
I2 = I1 + region.GetSize() - 1


      Regards,


            Luis


-----------------------------------------------------
On Fri, Dec 10, 2010 at 7:25 AM, Alberto <bertorey at gmail.com> wrote:
> Hi,
>
> I need the diagonal pixels of a DICOM image because I want to compute
> the acumulative histogram  in order to get the maximun slope.
> Does anyone know if there is a simple way to iterate along a diagonal of
> a dicom image or select these pixels ?.
>
> Thank you in advance.
> _____________________________________
> 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://www.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-users
>
>


More information about the Insight-users mailing list