profile_line function

Jaime Lopez Carvajal jalopcar at gmail.com
Tue Feb 23 18:40:25 EST 2016


Hi Juan,

I see your point, I read about the difference with Numpy indexing, but I 
did understand at that time. 
Your explanation is very clear, as well your suggestion about to use the 
shorter range.
Thanks for your time.

Jaime

On Tuesday, February 23, 2016 at 6:15:31 PM UTC-5, Juan Nunez-Iglesias 
wrote:
>
> Hi Jaime,
>
> It's a bit confusing, but, because profile_line is used in interactive 
> tools, *the final point is included in the line*, unlike normal 
> Python/NumPy indexing. It would be unintuitive in interactive tools *not* 
> to include the final point. (This is in the "Notes" section in the 
> docstring.) So, your final point, (0, 10), is actually outside your image, 
> and the constant value of 0 is returned. I suspect that for your use case 
> you want to call profile_line(img, (0, 0), (0, 9)) and profile_line(img, 
> (0, 0), (9, 9)). I think it should work as expected in those cases.
>
> I hope that helps!
>
> Juan.
>
> On Wed, Feb 24, 2016 at 1:33 AM, Jaime Lopez Carvajal <jalo... at gmail.com 
> <javascript:>> wrote:
>
>> Hi, 
>>
>> I would like to know why the function profile_line from profile.py in 
>> module skimage.measure, always return an additional value (zero value) at 
>> the end for horizontal and vertical lines, and two extra values (2 zeros) 
>> for diagonal lines.
>> I mean, if I have an image 10x10, and I want the profile line
>>
>> > a = profile_line(img, (0, 0), (0, 10))
>> > array([  83.,   82.,   81.,   88.,   95.,   88.,   93.,  107.,  121., 
>>  146.,   * 0.*])
>>
>> and with diagonal lines it returns two additional values (2 zeros), like 
>> this:
>>
>> > a = profile_line(img, (0, 0), (10, 10))
>> > array([  83.,   92.,  105.,  123.,  100.,   69.,   46.,   46.,   48.,   
>> 52.,   62.,   70.,   77.,   84.,    *0.,    0.*])
>>
>> Thanks in advance for your comments, 
>>
>> Jaime
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "scikit-image" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to scikit-image... at googlegroups.com <javascript:>.
>> To post to this group, send email to scikit... at googlegroups.com 
>> <javascript:>.
>> To view this discussion on the web, visit 
>> https://groups.google.com/d/msgid/scikit-image/d4e6af4a-b4de-49b1-9e57-6391e17dcb9b%40googlegroups.com 
>> <https://groups.google.com/d/msgid/scikit-image/d4e6af4a-b4de-49b1-9e57-6391e17dcb9b%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-image/attachments/20160223/794731f3/attachment.html>


More information about the scikit-image mailing list