[Insight-users] Calculation of the distance between the 2 farthest voxels of an image

Neil Panjwani paniwani at gmail.com
Sun Jun 12 15:49:53 EDT 2011


You can brute force and compute the distance between every white pixel, but
its not that efficient. See the attached file.

On Sun, Jun 12, 2011 at 9:58 AM, Pedro Névoa <pedronevoa at gmail.com> wrote:

> Hi,
>
> I forgot one detail. Not the distance between any voxels, but the distance
> between the 2 white (255) farthest voxels on a black (0) background!
>
> Thank you.
>
> Regards,
>
>
> 2011/6/12 Terry Yoo <tyoo at mail.nih.gov>
>
>>
>> Pedro:
>>
>> x^2 + y^2 + z^2 = d^2
>>
>> Simply:  The farthest distance is from one corner to the opposite corner
>> of a rectangular volume.
>>
>> max-distance = Sqrt((x-max * x-max) + (y-max * y-max) + (z-max * z-max))
>>
>> Or am I missing something, Pedro?  Were you asking something else?
>>
>> -Terry
>>
>> Terry S. Yoo, PhD
>> Office of High Performance Computing and Communications
>> National Library of Medicine
>> National Institutes of Health
>> tyoo at mail.nih.gov
>>
>>
>>
>> On Jun 11, 2011, at 4:54 PM, Pedro Névoa wrote:
>>
>> > Hello,
>> >
>> > Does anyone know a method to calculate the distance between the 2
>> farthest voxels of an image?
>> >
>> > Thank you.
>> >
>> > Regards,
>> >
>> > --
>> > Pedro Névoa
>> >
>> > <ATT00001..txt>
>>
>>
>
>
> --
> Pedro Névoa
>
>
> _____________________________________
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110612/e4c76f79/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MaxDist.cxx
Type: application/octet-stream
Size: 2246 bytes
Desc: not available
URL: <http://www.itk.org/pipermail/insight-users/attachments/20110612/e4c76f79/attachment.obj>


More information about the Insight-users mailing list