How/where in the code are segmentations saved?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

How/where in the code are segmentations saved?

Kynn Jones
I understand that ImageJ offers the possibility of saving to disk the
result of an image segmentation.

What format is used to save a segmentation?  IOW, how is the
segmentation encoded/serialized?  Also, where in the source code
should I look to get the algorithmic details of how this is done?

Thanks!

kynnjo
Reply | Threaded
Open this post in threaded view
|

Re: How/where in the code are segmentations saved?

dscho
Hi Kynn,

On Sat, 4 Jun 2011, Kynn Jones wrote:

> I understand that ImageJ offers the possibility of saving to disk the
> result of an image segmentation.

Are you referring to ROIs?

> What format is used to save a segmentation?  IOW, how is the
> segmentation encoded/serialized?  Also, where in the source code should
> I look to get the algorithmic details of how this is done?

If you are referring to ROIs, the saving is implemented here:

http://fiji.sc/cgi-bin/gitweb.cgi?p=ImageJA.git;a=blob;f=ij/io/RoiEncoder.java;hb=refs/heads/master

and the loading here:

http://fiji.sc/cgi-bin/gitweb.cgi?p=ImageJA.git;a=blob;f=ij/io/RoiDecoder.java;hb=refs/heads/master

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: How/where in the code are segmentations saved?

dscho
Hi Kynn,

On Sun, 5 Jun 2011, Kynn Jones wrote:

> On Sun, Jun 5, 2011 at 4:14 AM, Johannes Schindelin
> <[hidden email]> wrote:
>
> > On Sat, 4 Jun 2011, Kynn Jones wrote:
> >
> >> I understand that ImageJ offers the possibility of saving to disk the
> >> result of an image segmentation.
> >
> > Are you referring to ROIs?
>
> Not sure.  What I mean is this: suppose you run some image segmentation.  

Well, if you give me a concrete example what plugin you run, then I can
tell you the nature of the output. Frequently it is just binary (or
indexed) images. In which case saving/loading is the same as with other
images.

> The result of this segmentation can be used in further analyses, so one
> can think of them as "intermediate results".  It would be useful to be
> able to save these intermediate segmentation results to disk, and reload
> them later, so that various analyses can be performed on the same
> intermediate segmentation results at different times.  If these
> intermediate segmentation results are expressed, somehow, as a
> collection of ROIs, then yes this is what I mean.  In this case, my
> question reduces to "how are ROIs serialized?"
>  I'll look at the links you posted.  Thanks!

There is a quite thorough concept of ROIs (possibly overlapping, multiple
classes, iterators, etc) in ImageJ2. Maybe you want to have a look:

http://fiji.sc/cgi-bin/gitweb.cgi?p=imagej2/.git;a=tree;f=core/data/src/main/java/imagej/data/roi;h=620598150f9ea14ee4f6cf274c730680ea204a03;hb=3d8fe33cd541d021b677fe4ccabde8977e25ca57

Note, however, that this ROI framework is not yet in the form where you
can expect things to Just Work. But it gives you an idea of the future
direction.

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: How/where in the code are segmentations saved?

dscho
Hi Kynn,

On Sun, 5 Jun 2011, Johannes Schindelin wrote:

> On Sun, 5 Jun 2011, Kynn Jones wrote:
>
> > On Sun, Jun 5, 2011 at 4:14 AM, Johannes Schindelin
> > <[hidden email]> wrote:
> >
> > > On Sat, 4 Jun 2011, Kynn Jones wrote:
> > >
> > >> I understand that ImageJ offers the possibility of saving to disk
> > >> the result of an image segmentation.
> > >
> > > Are you referring to ROIs?
> >
> > Not sure.  What I mean is this: suppose you run some image
> > segmentation.
>
> Well, if you give me a concrete example what plugin you run, then I can
> tell you the nature of the output. Frequently it is just binary (or
> indexed) images. In which case saving/loading is the same as with other
> images.
>
> > The result of this segmentation can be used in further analyses, so
> > one can think of them as "intermediate results".  It would be useful
> > to be able to save these intermediate segmentation results to disk,
> > and reload them later, so that various analyses can be performed on
> > the same intermediate segmentation results at different times.  If
> > these intermediate segmentation results are expressed, somehow, as a
> > collection of ROIs, then yes this is what I mean.  In this case, my
> > question reduces to "how are ROIs serialized?"
> >  I'll look at the links you posted.  Thanks!
>
> There is a quite thorough concept of ROIs (possibly overlapping,
> multiple classes, iterators, etc) in ImageJ2. Maybe you want to have a
> look:
>
> http://fiji.sc/cgi-bin/gitweb.cgi?p=imagej2/.git;a=tree;f=core/data/src/main/java/imagej/data/roi;h=620598150f9ea14ee4f6cf274c730680ea204a03;hb=3d8fe33cd541d021b677fe4ccabde8977e25ca57
>
> Note, however, that this ROI framework is not yet in the form where you
> can expect things to Just Work. But it gives you an idea of the future
> direction.

Of course I forgot to add the link to the actual data structures:

http://fiji.sc/cgi-bin/gitweb.cgi?p=imglib.git;a=tree;f=imglib2/core/src/main/java/net/imglib2/roi;h=517700ada29c3ed1b3337ade8bc2a8dc0a913f8f;hb=464f3be5f7bddfc33069dc574f1afe4a8316a63c

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: How/where in the code are segmentations saved?

Kynn Jones
On Sun, Jun 5, 2011 at 10:29 AM, Johannes Schindelin
<[hidden email]> wrote:

>> There is a quite thorough concept of ROIs (possibly overlapping,
>> multiple classes, iterators, etc) in ImageJ2. Maybe you want to have a
>> look:
>>
>> http://fiji.sc/cgi-bin/gitweb.cgi?p=imagej2/.git;a=tree;f=core/data/src/main/java/imagej/data/roi;h=620598150f9ea14ee4f6cf274c730680ea204a03;hb=3d8fe33cd541d021b677fe4ccabde8977e25ca57
>>
>> Note, however, that this ROI framework is not yet in the form where you
>> can expect things to Just Work. But it gives you an idea of the future
>> direction.
>
> Of course I forgot to add the link to the actual data structures:
>
> http://fiji.sc/cgi-bin/gitweb.cgi?p=imglib.git;a=tree;f=imglib2/core/src/main/java/net/imglib2/roi;h=517700ada29c3ed1b3337ade8bc2a8dc0a913f8f;hb=464f3be5f7bddfc33069dc574f1afe4a8316a63c


Hi Johannes, this info is all I need for now.  Thanks!

kj
Reply | Threaded
Open this post in threaded view
|

Re: How/where in the code are segmentations saved?

Sean Burke
In reply to this post by dscho
Along these lines is it possible to save the ROI or segmentation so that the positions and shapes of the segments can be reconstructed in another piece of software?




----------------------------------------------------
Sean Burke
Technical Applications Specialist
De Novo Software
[hidden email]
Phone: (213)814-1240 Ext. 806

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Johannes Schindelin
Sent: Sunday, June 05, 2011 10:29 AM
To: [hidden email]
Subject: Re: How/where in the code are segmentations saved?

Hi Kynn,

On Sun, 5 Jun 2011, Johannes Schindelin wrote:

> On Sun, 5 Jun 2011, Kynn Jones wrote:
>
> > On Sun, Jun 5, 2011 at 4:14 AM, Johannes Schindelin
> > <[hidden email]> wrote:
> >
> > > On Sat, 4 Jun 2011, Kynn Jones wrote:
> > >
> > >> I understand that ImageJ offers the possibility of saving to disk
> > >> the result of an image segmentation.
> > >
> > > Are you referring to ROIs?
> >
> > Not sure.  What I mean is this: suppose you run some image
> > segmentation.
>
> Well, if you give me a concrete example what plugin you run, then I
> can tell you the nature of the output. Frequently it is just binary
> (or
> indexed) images. In which case saving/loading is the same as with
> other images.
>
> > The result of this segmentation can be used in further analyses, so
> > one can think of them as "intermediate results".  It would be useful
> > to be able to save these intermediate segmentation results to disk,
> > and reload them later, so that various analyses can be performed on
> > the same intermediate segmentation results at different times.  If
> > these intermediate segmentation results are expressed, somehow, as a
> > collection of ROIs, then yes this is what I mean.  In this case, my
> > question reduces to "how are ROIs serialized?"
> >  I'll look at the links you posted.  Thanks!
>
> There is a quite thorough concept of ROIs (possibly overlapping,
> multiple classes, iterators, etc) in ImageJ2. Maybe you want to have a
> look:
>
> http://fiji.sc/cgi-bin/gitweb.cgi?p=imagej2/.git;a=tree;f=core/data/sr
> c/main/java/imagej/data/roi;h=620598150f9ea14ee4f6cf274c730680ea204a03
> ;hb=3d8fe33cd541d021b677fe4ccabde8977e25ca57
>
> Note, however, that this ROI framework is not yet in the form where
> you can expect things to Just Work. But it gives you an idea of the
> future direction.

Of course I forgot to add the link to the actual data structures:

http://fiji.sc/cgi-bin/gitweb.cgi?p=imglib.git;a=tree;f=imglib2/core/src/main/java/net/imglib2/roi;h=517700ada29c3ed1b3337ade8bc2a8dc0a913f8f;hb=464f3be5f7bddfc33069dc574f1afe4a8316a63c

Ciao,
Johannes
Reply | Threaded
Open this post in threaded view
|

Re: How/where in the code are segmentations saved?

Nathaniel Ryckman
Yes and no. If you are not a programmer, then no.

If you are a programmer, you should download the source code and use these 2 class files:

ij.gui.Roi.java
ij.io.RoiDecoder.java

Source code:

http://rsbweb.nih.gov/ij/download/src/

Also, it depends on how much control you have with the other software. If you don't know exactly what type of input the other software uses, then you won't be able to use the Roi's even if you are a programmer.

Sean Burke wrote
Along these lines is it possible to save the ROI or segmentation so that the positions and shapes of the segments can be reconstructed in another piece of software?




----------------------------------------------------
Sean Burke
Technical Applications Specialist
De Novo Software
[hidden email]
Phone: (213)814-1240 Ext. 806

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Johannes Schindelin
Sent: Sunday, June 05, 2011 10:29 AM
To: [hidden email]
Subject: Re: How/where in the code are segmentations saved?

Hi Kynn,

On Sun, 5 Jun 2011, Johannes Schindelin wrote:

> On Sun, 5 Jun 2011, Kynn Jones wrote:
>
> > On Sun, Jun 5, 2011 at 4:14 AM, Johannes Schindelin
> > <[hidden email]> wrote:
> >
> > > On Sat, 4 Jun 2011, Kynn Jones wrote:
> > >
> > >> I understand that ImageJ offers the possibility of saving to disk
> > >> the result of an image segmentation.
> > >
> > > Are you referring to ROIs?
> >
> > Not sure.  What I mean is this: suppose you run some image
> > segmentation.
>
> Well, if you give me a concrete example what plugin you run, then I
> can tell you the nature of the output. Frequently it is just binary
> (or
> indexed) images. In which case saving/loading is the same as with
> other images.
>
> > The result of this segmentation can be used in further analyses, so
> > one can think of them as "intermediate results".  It would be useful
> > to be able to save these intermediate segmentation results to disk,
> > and reload them later, so that various analyses can be performed on
> > the same intermediate segmentation results at different times.  If
> > these intermediate segmentation results are expressed, somehow, as a
> > collection of ROIs, then yes this is what I mean.  In this case, my
> > question reduces to "how are ROIs serialized?"
> >  I'll look at the links you posted.  Thanks!
>
> There is a quite thorough concept of ROIs (possibly overlapping,
> multiple classes, iterators, etc) in ImageJ2. Maybe you want to have a
> look:
>
> http://fiji.sc/cgi-bin/gitweb.cgi?p=imagej2/.git;a=tree;f=core/data/sr
> c/main/java/imagej/data/roi;h=620598150f9ea14ee4f6cf274c730680ea204a03
> ;hb=3d8fe33cd541d021b677fe4ccabde8977e25ca57
>
> Note, however, that this ROI framework is not yet in the form where
> you can expect things to Just Work. But it gives you an idea of the
> future direction.

Of course I forgot to add the link to the actual data structures:

http://fiji.sc/cgi-bin/gitweb.cgi?p=imglib.git;a=tree;f=imglib2/core/src/main/java/net/imglib2/roi;h=517700ada29c3ed1b3337ade8bc2a8dc0a913f8f;hb=464f3be5f7bddfc33069dc574f1afe4a8316a63c

Ciao,
Johannes