<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi Jay,<br>
<br>
See my answers below. I hope this helps.<br>
<br>
Christian<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 14.05.2015 20:44, Jay Warrick wrote:<br>
</div>
<blockquote cite="mid:99B3F413-5434-4FB2-9812-F875FD3A9C1A@wisc.edu"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<div class="">Hi Christian,</div>
<div class=""><br class="">
</div>
Thanks so much! This helps a lot. I probably wouldn't have
discovered the tools for labeling immediately without your
suggestion. Although I've gone through the tutorials, I'm still
new to ImgLib2 so I wonder if I could try to summarize what I
think the general workflow to be with an example and maybe you can
correct me / direct me as I go? As a place to start, I'm imagining
a scenario where I have a 1-plane, 1-channel nuclear stained image
of cells and its associated thresholded image to
identhttps://github.com/imglib/imglib2-roi/tree/master/src/main/java/net/imglib2/roiify
nuclear regions for quantifying feature sets. At a high-level,
what I imagine trying to do is...</blockquote>
<br>
In KNIME we are still using the deprecated versions of the Labeling.
Tobias Pietzsch rewrote parts of this framework (thats why
NativeImgLabeling for example is deprecated). The new
implementations, you can find here: <br>
<a class="moz-txt-link-freetext" href="https://github.com/imglib/imglib2-roi/tree/master/src/main/java/net/imglib2/roi">https://github.com/imglib/imglib2-roi/tree/master/src/main/java/net/imglib2/roi</a>.
We are going to switch to these implementations in KNIME soon.<br>
<br>
<blockquote cite="mid:99B3F413-5434-4FB2-9812-F875FD3A9C1A@wisc.edu"
type="cite">
<div class=""><br class="">
</div>
<div class="">1) Generate a labeling object. For example, using
the following...</div>
<div class=""><br class="">
final Labeling< T > labeling = new NativeImgLabeling< T, IntType >(
Img < T > );</div>
</blockquote>
<br>
In the new ROI implementations you would use ImgLabeling
(<a class="moz-txt-link-freetext" href="https://github.com/imglib/imglib2-roi/blob/master/src/main/java/net/imglib2/roi/labeling/ImgLabeling.java">https://github.com/imglib/imglib2-roi/blob/master/src/main/java/net/imglib2/roi/labeling/ImgLabeling.java</a>)
instead of NativeImgLabeling.<br>
<br>
<blockquote cite="mid:99B3F413-5434-4FB2-9812-F875FD3A9C1A@wisc.edu"
type="cite">
<div class=""><br class="">
</div>
<div class=""><b class="">I assume this simplified constructor
takes what could be a "black and white" image and associates
Long numbers with each separate region of white pixels.
Right? How might I reassign labels or construct them if, for
example, I have specific IDs that I would like to associate
with each white region of the mask image I would like to
label?</b></div>
</blockquote>
<br>
Actually, the constructor takes an Img of arbitrary integer-type
which serves as an index image. From each Integer there exists a
mapping to a Set of labels. If you want to derive a Labeling from a
"Black and White" image, you have to apply an algorithm. For example
a Connected Component Analysis (this is one way to do it in KNIME,
for example after a simple thresholding), to identify the individual
objects in your "Black and White" image.<br>
<br>
<blockquote cite="mid:99B3F413-5434-4FB2-9812-F875FD3A9C1A@wisc.edu"
type="cite">
<div class=""><br class="">
</div>
<div class="">2) Once I have a labeling, it seems like the next
step is to obtain an IterableInterval over an ROI that can
return "x-y locations" of pixels with a particular label. I
assume to get this I would use something like...</div>
<div class=""><br class="">
</div>
<div class="">labeling.getIterableRegionOfInterest(i).getIterableIntervalOverROI(src)</div>
</blockquote>
<br>
Right! In the new implementations you would do something like: <br>
<br>
ImgLabeling<String, IntType> labeling = new
ImgLabeling<String, IntType>(...);<br>
LabelRegions<String> regions = new
LabelRegions<String>(labeling);
<br>
Iterator<LabelRegion<String>> labelIter =
regions.iterator();
<br>
<br>
and then use Regions.sample(...) to overlay the region on some
arbitrary image.<br>
<blockquote cite="mid:99B3F413-5434-4FB2-9812-F875FD3A9C1A@wisc.edu"
type="cite">
<div class=""><br class="">
</div>
<div class="">I can see where sometimes I only care about the
shape of the ROI (e.g., with Zernike shape features) and other
times I want pixel intensities at those locations (e.g., texture
features). <b class="">For the latter case, I assume "src"
could be an image whose pixel values I'm interested at these
locations, essentially applying an ROI to a particular image.
Right? For other scenarios where only shape matters, would I
use "labeling.getRegionOfInterest()" and that would be
sufficient? Does the Zernike feature set prefer ROIs that
define the boundaries of the shape or the whole region of the
shape and it figures out the boundaries itself?</b></div>
</blockquote>
<br>
Correct. In some cases (e.g. Shape) the input is just the
LabelRegion (new wording from new implementation of Tobias), in
other cases you want to sample over the pixels of another image in
this region (Regions.sample()).<br>
<br>
<blockquote cite="mid:99B3F413-5434-4FB2-9812-F875FD3A9C1A@wisc.edu"
type="cite">
<div class=""><br class="">
</div>
<div class="">3) Then I suppose I loop through the labels in the
"labeling" object to get these ROIs and pass them to the
FeatureSet ops accessing the data as you do in the provided
example and storing the data however I like.</div>
<div class=""><br class="">
</div>
<div class=""><b class="">Is that about right?</b></div>
</blockquote>
<br>
Sounds good.<br>
<br>
<blockquote cite="mid:99B3F413-5434-4FB2-9812-F875FD3A9C1A@wisc.edu"
type="cite">
<div class=""><br class="">
</div>
<div class="">Lastly, related to Step 1,it looks like a labeling
can hold multiple labels for each pixel location. <b class="">Is
the idea there to allow regions to overlap?</b></div>
</blockquote>
<br>
Absolutely. Overlap or more meta-information about objects (TrackID,
Classification Result, ...).<br>
<br>
<blockquote cite="mid:99B3F413-5434-4FB2-9812-F875FD3A9C1A@wisc.edu"
type="cite">
<div class=""><b class=""> If I'm generally interested in keeping
pixels associated with a maximum of one cell, would I use this
feature for anything else and if so, what sort of workflow is
envisioned for creating these different labelings and
essentially ending up with the merged information in a single
labeling object?</b></div>
</blockquote>
<br>
Speaking about workflows: On
<a class="moz-txt-link-freetext" href="https://tech.knime.org/community/image-processing">https://tech.knime.org/community/image-processing</a> there is an
example workflow called High-Content-Screening where we make use of
a labeling. Maybe this helps you, too.<br>
<br>
<blockquote cite="mid:99B3F413-5434-4FB2-9812-F875FD3A9C1A@wisc.edu"
type="cite">
<div class=""><br class="">
</div>
<div class="">Thanks!!!</div>
<div class=""><br class="">
</div>
<div class="">Jay</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On May 13, 2015, at 8:22 AM, Christian Dietz
<<a moz-do-not-send="true"
href="mailto:Christian.Dietz@uni-konstanz.de" class="">Christian.Dietz@uni-konstanz.de</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<div class="">Hi Jay,<br class="">
<br class="">
you are right, we are working on this project since a
while. The goal of the work we are doing is to have
efficient implementations for most of the well known
features which can be derived from images or ROIs. The
main work is done on the following branch:<br class="">
<br class="">
<a moz-do-not-send="true"
href="https://github.com/imagej/imagej-ops/tree/outputop-service"
class="">https://github.com/imagej/imagej-ops/tree/outputop-service</a><br
class="">
<br class="">
and there is an open issue documenting the process:<br
class="">
<br class="">
<a class="moz-txt-link-freetext" href="https://github.com/imagej/imagej-ops/issues/67">https://github.com/imagej/imagej-ops/issues/67</a><br class="">
<br class="">
A very small example how to use the features is given at:<br
class="">
<br class="">
<a class="moz-txt-link-freetext" href="https://github.com/imagej/imagej-ops/blob/outputop-service/src/main/java/net/imagej/ops/features/Example.java">https://github.com/imagej/imagej-ops/blob/outputop-service/src/main/java/net/imagej/ops/features/Example.java</a><br
class="">
<br class="">
Concerning your question with ROIs: The features
implementation do not really care if they get an Img or a
ROI. The only thing they expect is to get some
IterableInterval or Iterable or RandomAccessibleInterval
etc (depends on the type of feature). In KNIME we use
Labelings
(<a class="moz-txt-link-freetext" href="https://github.com/imglib/imglib2-roi/tree/master/src">https://github.com/imglib/imglib2-roi/tree/master/src</a>) to
describe our segmentations and derive or ROIs.<br class="">
<br class="">
Does this help you? It would be great if you want to
contribute to the outputop-service and maybe implement
some of the missing features.<br class="">
<br class="">
Best,<br class="">
<br class="">
Christian<br class="">
<br class="">
<br class="">
<br class="">
<br class="">
On 13.05.2015 06:27, Jay Warrick wrote:<br class="">
<blockquote type="cite" class="">Hi All,<br class="">
<br class="">
I was hoping to find some info on the 'feature service'
or 'haralick' branch of imagej-ops (at least those look
like to two most developed branches for feature
extraction). The creation of feature set ops is a really
great idea and thanks to everyone who is working on it.
Likewise, I would certainly be willing to try and help
fill out some features if it seems appropriate,
especially when I get more familiar with the ops
framework. Also, please let me know if there are any
concerns with me using any of these tools prior to the
authors publishing on/with these implementations
themselves. My work is still preliminary, but just
wanted to ask to be safe.<br class="">
<br class="">
I realize the 'feature service' and 'haralick' branches
are somewhat WIPs but it seems there are many rich
feature sets that appear to be nearly or completely
implemented and was hoping to try and use them if
possible... Towards this goal, I was able to use the
FirstOrderStatFeatureSet and ZernikeFeatureSet classes
to get information from an Img / ImgPlus / SCIFIOImgPlus
using the example provided in the branch. However, it is
unclear to me how the classes should be used to do this
for each cell in an image. Is it assumed that we are
feeding in small cropped and masked regions to the
feature set ops? If so, suggestions on an efficient way
to do so (or links to examples in other projects...
Knime?) would be amazing. I'm generally able to identify
cells and create ROIs and mask images etc
programmatically in Java with ImageJ classes, but
haven't done so with Img-related image objects yet. With
a hint or two, I can try and take it from there. Maybe
do the cropping etc with old I<br class="">
mageJ classes and wrap the resultant cropped regions in
Img objects? Maybe I'm way off base and I'm supposed to
be using ROIs somewhere in the mix with the ops.
Hopefully someone can set me straight :-)<br class="">
<br class="">
Thanks a bunch in advance.<br class="">
<br class="">
Best,<br class="">
<br class="">
Jay<br class="">
_______________________________________________<br
class="">
ImageJ-devel mailing list<br class="">
<a class="moz-txt-link-abbreviated" href="mailto:ImageJ-devel@imagej.net">ImageJ-devel@imagej.net</a><br class="">
<a class="moz-txt-link-freetext" href="http://imagej.net/mailman/listinfo/imagej-devel">http://imagej.net/mailman/listinfo/imagej-devel</a><br
class="">
</blockquote>
<br class="">
<br class="">
<br class="">
_______________________________________________<br
class="">
ImageJ-devel mailing list<br class="">
<a class="moz-txt-link-abbreviated" href="mailto:ImageJ-devel@imagej.net">ImageJ-devel@imagej.net</a><br class="">
<a class="moz-txt-link-freetext" href="http://imagej.net/mailman/listinfo/imagej-devel">http://imagej.net/mailman/listinfo/imagej-devel</a><br
class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</blockquote>
<br>
</body>
</html>