regionprops - displaying region properties
Juan Nunez-Iglesias
jni.soma at gmail.com
Sun Mar 29 22:55:39 EDT 2015
Hi Ciaran,
Probably the preferred way of sharing IPython notebooks is to post them to gist.github.com and share the link from nbviewer.
There's actually a gist extension to IPython notebook that will do this automagically for you:
http://nbviewer.ipython.org/gist/minrk/4982809
(Read the whole article before doing anything!)
Juan.
On Mon, Mar 30, 2015 at 3:01 AM, null <ciaran.robb at googlemail.com> wrote:
> Hi,
> Sorry for the delay, I have been bogged down with writing papers!
> I have attached an Ipython notebook with an example routine using one of
> the skimage.data images.
> Ciaran
> On Monday, March 2, 2015 at 11:38:21 PM UTC, Johannes Schönberger wrote:
>>
>> Maybe, there is a way to elegantly integrate this into the RegionProperty
>> class?
>>
>> Could you share your current implementation, so we can decide for a good
>> strategy?
>>
>> > On Mar 2, 2015, at 6:02 PM, ciara... at googlemail.com <javascript:>
>> wrote:
>> >
>> > Hi Johannes,
>> >
>> > Yeah of course. Would it be best placed in module color?
>> >
>> > Ciaran
>> >
>> > On Monday, March 2, 2015 at 5:26:12 PM UTC, Johannes Schönberger wrote:
>> > That sounds great. Would you be willing to work on integrating this into
>> skimage?
>> >
>> > Thanks.
>> >
>> > > On Feb 26, 2015, at 11:51 AM, ciara... at googlemail.com wrote:
>> > >
>> > > Hi
>> > > Adding to my own post but hey....
>> > >
>> > > I have since written my own code which allows visualising of region
>> properties (eg area, eccentricity etc) via colormap, if anyone is
>> interested let me know!
>> > >
>> > > Ciaran
>> > >
>> > > On Sunday, February 1, 2015 at 11:45:44 PM UTC,
>> ciara... at googlemail.com wrote:
>> > > Hello everyone,
>> > >
>> > > I have recently been attempting to modify some existing skimage code
>> to display regionprops for a labeled image (e.g. area or eccentricity)
>> > >
>> > > I initially tried to translate a vectorized bit of old matlab code I
>> had, but gave up on that and decided to alter the existing label2rgb
>> skimage function
>> > >
>> > > I am attempting to change each label value to it's area property value
>> similar to the label2rgb "avg" function.
>> > >
>> > > so I have:
>> > > labels = a labeled image
>> > >
>> > > out = np.zeros_like(labels) #a blank array
>> > > labels2 = np.unique(labels) #a vector of label vals
>> > > out = np.zeros_like(labels)
>> > > Props = regionprops(labels, ['Area'])
>> > > bg_label=0
>> > > bg = (labels2 == bg_label)
>> > > if bg.any():
>> > > labels2 = labels2[labels2 != bg_label]
>> > > out[bg] = 0
>> > > for label in labels2:
>> > > mask = (labels == label).nonzero()
>> > > color = Props[label].area
>> > > out[mask] = color
>> > > but the "out" props image does not correspond to the correct area
>> values?
>> > > Can anyone help me with this?
>> > > It also throws the following error:
>> > > "list index out of range"
>> > > It would certainly be useful to have a way to view the spatial
>> distribution of label properties in this way - perhaps in a future skimage
>> version?
>> > >
>> > >
>> > > --
>> > > 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.
>> > > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>> > --
>> > 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:>.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
> --
> 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+unsubscribe at googlegroups.com.
> 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/20150329/3654925c/attachment.html>
More information about the scikit-image
mailing list