Copy volume from within stack to new stack

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

Copy volume from within stack to new stack

Michael Doube
Hi all

I think my brain turned to mush over New Years because I can't get this
simple task to work.  I have a stack, coordinates of a start position
and a volume of interest's width, height and depth.  I want to copy the
source stack's pixel values into a new stack which has the same
dimensions of the volume of interest. This code results in a new stack
("Target") containing the last slice of the volume of interest on all of
its slices:

Cheers,

Mike

//copy box of pixels that contains sphere (i.e. is centred on centroid
//and has 2*radius sides)
        int startX = (int)Math.round((centroid[0]-radius)/vW);
        int startY = (int)Math.round((centroid[1]-radius)/vH);
        int startZ = (int)Math.round((centroid[2]-radius)/vD);
        int roiWidth = (int)Math.round(2*radius/vW);
        int roiHeight = (int)Math.round(2*radius/vH);
        int roiDepth = (int)Math.round(2*radius/vD);
        ImageStack targetStack = new ImageStack(roiWidth,roiHeight);
        short[] roiPixels = new short[roiWidth*roiHeight];
        for (int z = startZ; z <= startZ+roiDepth; z++){
                imp.setSlice(z);
                int nRows = 0;
                for (int y = startY; y < startY+roiHeight; y++){
                        int index = nRows*roiWidth;
                        int nCols = 0;
                        for (int x = startX; x < startX+roiWidth; x++){
                                roiPixels[index+nCols] = (short)ip.getPixel(x,y);
                                nCols++;
                        }
                        nRows++;
                }
                targetStack.addSlice("slice "+z, roiPixels);
        }
        ImagePlus target = new ImagePlus("Target", targetStack);
        target.show();
Reply | Threaded
Open this post in threaded view
|

Re: Copy volume from within stack to new stack

Michael Doube
OK. To answer my own question, I had to move a line

  short[] roiPixels = new short[roiWidth*roiHeight];

 From outside to inside the

for (int z = startZ; z <= startZ+roiDepth; z++)

loop.

Can anyone tell me why this makes a difference?

Mike

Michael Doube wrote:

> Hi all
>
> I think my brain turned to mush over New Years because I can't get this
> simple task to work.  I have a stack, coordinates of a start position
> and a volume of interest's width, height and depth.  I want to copy the
> source stack's pixel values into a new stack which has the same
> dimensions of the volume of interest. This code results in a new stack
> ("Target") containing the last slice of the volume of interest on all of
> its slices:
>
> Cheers,
>
> Mike
>
> //copy box of pixels that contains sphere (i.e. is centred on centroid
> //and has 2*radius sides)
> int startX = (int)Math.round((centroid[0]-radius)/vW);
> int startY = (int)Math.round((centroid[1]-radius)/vH);
> int startZ = (int)Math.round((centroid[2]-radius)/vD);
> int roiWidth = (int)Math.round(2*radius/vW);
> int roiHeight = (int)Math.round(2*radius/vH);
> int roiDepth = (int)Math.round(2*radius/vD);
> ImageStack targetStack = new ImageStack(roiWidth,roiHeight);
> short[] roiPixels = new short[roiWidth*roiHeight];
> for (int z = startZ; z <= startZ+roiDepth; z++){
> imp.setSlice(z);
> int nRows = 0;
> for (int y = startY; y < startY+roiHeight; y++){
> int index = nRows*roiWidth;
> int nCols = 0;
> for (int x = startX; x < startX+roiWidth; x++){
> roiPixels[index+nCols] = (short)ip.getPixel(x,y);
> nCols++;
> }
> nRows++;
> }
> targetStack.addSlice("slice "+z, roiPixels);
> }
> ImagePlus target = new ImagePlus("Target", targetStack);
> target.show();
Reply | Threaded
Open this post in threaded view
|

Re: Copy volume from within stack to new stack

vbindokas
In reply to this post by Michael Doube
Dear Mike,
    Easier route? :  Why not do use the Image/Duplicate with the "entire
stack" box checked? (this copies just the ROI)
If the issue was the definition of the size/locale, you can likely feed
that in by the Edit/selection/specify with your derived params.
cheers,


Michael Doube wrote:

> Hi all
>
> I think my brain turned to mush over New Years because I can't get
> this simple task to work.  I have a stack, coordinates of a start
> position and a volume of interest's width, height and depth.  I want
> to copy the source stack's pixel values into a new stack which has the
> same dimensions of the volume of interest. This code results in a new
> stack ("Target") containing the last slice of the volume of interest
> on all of its slices:
>
> Cheers,
>
> Mike
>
> //copy box of pixels that contains sphere (i.e. is centred on centroid
> //and has 2*radius sides)
>     int startX = (int)Math.round((centroid[0]-radius)/vW);
>     int startY = (int)Math.round((centroid[1]-radius)/vH);
>     int startZ = (int)Math.round((centroid[2]-radius)/vD);
>     int roiWidth = (int)Math.round(2*radius/vW);
>     int roiHeight = (int)Math.round(2*radius/vH);
>     int roiDepth = (int)Math.round(2*radius/vD);
>     ImageStack targetStack = new ImageStack(roiWidth,roiHeight);
>     short[] roiPixels = new short[roiWidth*roiHeight];
>     for (int z = startZ; z <= startZ+roiDepth; z++){
>         imp.setSlice(z);
>         int nRows = 0;
>         for (int y = startY; y < startY+roiHeight; y++){
>             int index = nRows*roiWidth;
>             int nCols = 0;
>             for (int x = startX; x < startX+roiWidth; x++){
>                 roiPixels[index+nCols] = (short)ip.getPixel(x,y);
>                 nCols++;
>             }
>             nRows++;
>         }
>         targetStack.addSlice("slice "+z, roiPixels);
>     }
>     ImagePlus target = new ImagePlus("Target", targetStack);
>     target.show();

--
__

Vytas Bindokas, Ph.D.
Research Assoc. / Assoc. Prof.,
Director, BSD Light Microscopy Core Facility
Dept Neurobiol Pharmacol Physiol MC0926
947 E 58th Street
The University of Chicago
Chicago IL 60637
Room Abbott 120
773-702-4875

email [hidden email]
web site for LMCF:
http://digital.bsd.uchicago.edu/index.html
Reply | Threaded
Open this post in threaded view
|

Re: Copy volume from within stack to new stack

dscho
In reply to this post by Michael Doube
Hi,

On Mon, 19 Jan 2009, Michael Doube wrote:

> OK. To answer my own question, I had to move a line
>
>   short[] roiPixels = new short[roiWidth*roiHeight];
>
> From outside to inside the
>
> for (int z = startZ; z <= startZ+roiDepth; z++)
>
> loop.
>
> Can anyone tell me why this makes a difference?

Java objects -- and arrays are very much an object, not a primitive -- are
always passed by reference, that is if you do pass an array to a
constructor which keeps a reference around, and you change the array
later, the newly created class will get the changes, too.

This is very much what is happening here: ShortProcessor does not make a
copy, but uses the pixels directly.  But in the next loop iteration you
changed the pixels array.

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

Re: Copy volume from within stack to new stack

dscho
In reply to this post by vbindokas
Hi,

On Mon, 19 Jan 2009, vbindoka wrote:

> Easier route? :  Why not do use the Image/Duplicate with the "entire
> stack" box checked? (this copies just the ROI)

That would not decrease the z-size, which Michael wanted to do.

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

XYZT visualization

Aryeh Weiss
In reply to this post by Michael Doube
Is there a volume viewer in ImageJ that can display a time series of volumes?
Something like the 3D-viewer, but with a slider on the bottom that would allow
one to select the volume at any given time point?

--aryeh
--
Aryeh Weiss
School of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384050
Reply | Threaded
Open this post in threaded view
|

Re: Copy volume from within stack to new stack

Gabriel Landini
In reply to this post by dscho
On Monday 19 January 2009 18:26:23 Johannes Schindelin wrote:
> Hi,
>
> On Mon, 19 Jan 2009, vbindoka wrote:
> > Easier route? :  Why not do use the Image/Duplicate with the "entire
> > stack" box checked? (this copies just the ROI)
>
> That would not decrease the z-size, which Michael wanted to do.

What about, crop the stack, then reslice and re-crop the z-dimension which is
now a "croppable" (what a word!) dimension (let's say y-dimension if one
reslices from the top) and finally reslice back.

I hope it helps

Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: XYZT visualization

Benjamin Schmid-2
In reply to this post by Aryeh Weiss
Hi Aryeh,

The 3D Viewer has the capability to load 4D data. You get a small
dialog, with which you can go to certain timepoints, or you can
animate it. However, it is some time ago that I worked on this, and
it might not fully work as you expect. But in case you want to
use it and have problems / find bugs, I have motivation again to
improve this ;-)

Wishes,
Benjamin

PS: -> You start the 4D Viewer by clicking on -> File -> Load 4D data in
the 3D viewer's menu bar.


On 21:07 Mon 19 Jan     , Aryeh Weiss wrote:

> Is there a volume viewer in ImageJ that can display a time series of volumes?
> Something like the 3D-viewer, but with a slider on the bottom that would
> allow one to select the volume at any given time point?
>
> --aryeh
> --
> Aryeh Weiss
> School of Engineering
> Bar Ilan University
> Ramat Gan 52900 Israel
>
> Ph:  972-3-5317638
> FAX: 972-3-7384050
Reply | Threaded
Open this post in threaded view
|

Re: Copy volume from within stack to new stack

Michael Doube
In reply to this post by Gabriel Landini
Nice idea Gabriel - but my stacks are so huge (12GB+ of microCT) that memory and time preclude this sort of approach.  I did fix the plugin to do as I want though...

Cheers,

Mike

________________________________________
From: ImageJ Interest Group [[hidden email]] On Behalf Of Gabriel Landini [[hidden email]]
Sent: Tuesday, January 20, 2009 1:53 AM
To: [hidden email]
Subject: Re: Copy volume from within stack to new stack

On Monday 19 January 2009 18:26:23 Johannes Schindelin wrote:
> Hi,
>
> On Mon, 19 Jan 2009, vbindoka wrote:
> > Easier route? :  Why not do use the Image/Duplicate with the "entire
> > stack" box checked? (this copies just the ROI)
>
> That would not decrease the z-size, which Michael wanted to do.

What about, crop the stack, then reslice and re-crop the z-dimension which is
now a "croppable" (what a word!) dimension (let's say y-dimension if one
reslices from the top) and finally reslice back.

I hope it helps

Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: XYZT visualization

Philip Ershler
In reply to this post by Benjamin Schmid-2
Hi,
        Here is a macro although fairly basic, does the job. It takes a stack  
of images and creates a stack of 3D images. Just setup the Interactive  
3D viewer with the view and other settings that you want. Then execute  
this macro.

   n = nSlices;
   if (n==1) exit("Stack required");
   stack1 = getImageID;
   stack2 = 0;
   setBatchMode(true);
   for (i=1; i<=n; i++) {
     showProgress(i, n);
     selectImage(stack1);
     setSlice(i);
     run("Duplicate...", "title=temp");
     temp = getImageID;
     run("Interactive 3D Surface Plot", "snapshot=1");
     run("Copy");
     w = getWidth; h = getHeight;
     close;
     selectImage(temp);
     close;
     if (stack2==0) {
      newImage("Plots", "RGB", w, h, 1);
      stack2 = getImageID;
     } else {
      selectImage(stack2);
      run("Add Slice");
     }
     run("Paste");
   }
   setSlice(1);
   run("Select None");
   setBatchMode(false);

HTH,

Phil

On Jan 20, 2009, at 10:30 AM, Benjamin Schmid wrote:

> Hi Aryeh,
>
> The 3D Viewer has the capability to load 4D data. You get a small
> dialog, with which you can go to certain timepoints, or you can
> animate it. However, it is some time ago that I worked on this, and
> it might not fully work as you expect. But in case you want to
> use it and have problems / find bugs, I have motivation again to
> improve this ;-)
>
> Wishes,
> Benjamin
>
> PS: -> You start the 4D Viewer by clicking on -> File -> Load 4D  
> data in
> the 3D viewer's menu bar.
>
>
> On 21:07 Mon 19 Jan     , Aryeh Weiss wrote:
>> Is there a volume viewer in ImageJ that can display a time series  
>> of volumes?
>> Something like the 3D-viewer, but with a slider on the bottom that  
>> would
>> allow one to select the volume at any given time point?
>>
>> --aryeh
>> --
>> Aryeh Weiss
>> School of Engineering
>> Bar Ilan University
>> Ramat Gan 52900 Israel
>>
>> Ph:  972-3-5317638
>> FAX: 972-3-7384050
Reply | Threaded
Open this post in threaded view
|

Re: XYZT visualization

Aryeh Weiss
In reply to this post by Benjamin Schmid-2
Hi Benjamin,

Thank you for your reply. This works, although getting the files written out is
a bit of a pain. It can be done in a macro, but the names have to be parsed to
get the order correct. What would really be nice is if one could load a
hyperstack directly into the volume viewer. That would save a lot of bookkeeping.

What would be really neat is if LOCI offered as one of its options to load 4D
data directly into the volume viewer. LOCI knows about the dimensions of the
dataset, so it should be able to feed the images to the viewer in the correct order.

Thanks also to Philip Ershler who replied with a macro that will create a stack
of 3D images to feed into the interactive volume viewer.

--aryeh

Benjamin Schmid wrote:

> Hi Aryeh,
>
> The 3D Viewer has the capability to load 4D data. You get a small
> dialog, with which you can go to certain timepoints, or you can
> animate it. However, it is some time ago that I worked on this, and
> it might not fully work as you expect. But in case you want to
> use it and have problems / find bugs, I have motivation again to
> improve this ;-)
>
> Wishes,
> Benjamin
>
> PS: -> You start the 4D Viewer by clicking on -> File -> Load 4D data in
> the 3D viewer's menu bar.
>
>
> On 21:07 Mon 19 Jan     , Aryeh Weiss wrote:
>> Is there a volume viewer in ImageJ that can display a time series of volumes?
>> Something like the 3D-viewer, but with a slider on the bottom that would
>> allow one to select the volume at any given time point?
>>
>> --aryeh
>> --
>> Aryeh Weiss
>> School of Engineering
>> Bar Ilan University
>> Ramat Gan 52900 Israel
>>
>> Ph:  972-3-5317638
>> FAX: 972-3-7384050
>
>
Reply | Threaded
Open this post in threaded view
|

Re: XYZT visualization

dscho
In reply to this post by Philip Ershler
Hi,

On Tue, 20 Jan 2009, Philip Ershler wrote:

> Hi,
> Here is a macro although fairly basic, does the job. It takes a stack
> of images and creates a stack of 3D images. Just setup the Interactive
> 3D viewer with the view and other settings that you want. Then execute
> this macro.

How does that give you a time axis in the 3D viewer?

AFAICT it takes all the slices of the current stack, one by one, turns
them into height fields _individually_, and then puts those height fields
into a new stack.

So rather than show XYZ data progressing in time, it takes an XYT
stack (two spatial dimensions and a time dimension), adds a (redundant)
3rd dimension reflecting the intensity of the slice's pixels, and puts the
result into another XYT stack.

Am I wrong?

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

Re: XYZT visualization

Philip Ershler
On Jan 20, 2009, at 2:39 PM, Johannes Schindelin wrote:

> Hi,
>
> On Tue, 20 Jan 2009, Philip Ershler wrote:
>
>> Hi,
>> Here is a macro although fairly basic, does the job. It takes a  
>> stack
>> of images and creates a stack of 3D images. Just setup the  
>> Interactive
>> 3D viewer with the view and other settings that you want. Then  
>> execute
>> this macro.
>
> How does that give you a time axis in the 3D viewer?
>
> AFAICT it takes all the slices of the current stack, one by one, turns
> them into height fields _individually_, and then puts those height  
> fields
> into a new stack.
>
> So rather than show XYZ data progressing in time, it takes an XYT
> stack (two spatial dimensions and a time dimension), adds a  
> (redundant)
> 3rd dimension reflecting the intensity of the slice's pixels, and  
> puts the
> result into another XYT stack.
>
> Am I wrong?
>

Yes I think you have misunderstood the process. The macro takes one XY  
image at a time, submits it to the Interactive 3D viewer, and the  
result is an XYZ image for that time point. This image is placed on a  
new stack. Then it takes the next image from the stack of XY images  
(which represents the next point in time) and creates an XYZ image for  
that time point and adds it to the new stack. The resulting new stack  
is an XYZT stack, allowing you to animate the XYZ images that are  
constructed from the original XY data.

I have an expanded version of this macro that will actually imbed the  
XY image up in the corner of the XYZ image. This allows you to see the  
XYT data along with the XYZT data. I couldn't find it quickly, but I  
know I've got it somewhere. I made a pretty dandy quicktime movie of  
the result.

Does this help?

Phil



> Ciao,
> Dscho
Reply | Threaded
Open this post in threaded view
|

Re: XYZT visualization

dscho
Hi,

On Tue, 20 Jan 2009, Philip Ershler wrote:

> On Jan 20, 2009, at 2:39 PM, Johannes Schindelin wrote:
>
> >On Tue, 20 Jan 2009, Philip Ershler wrote:
> >
> > > Here is a macro although fairly basic, does the job. It takes a
> > > stack of images and creates a stack of 3D images. Just setup the
> > > Interactive 3D viewer with the view and other settings that you
> > > want. Then execute this macro.
> >
> >How does that give you a time axis in the 3D viewer?
> >
> >AFAICT it takes all the slices of the current stack, one by one, turns
> >them into height fields _individually_, and then puts those height
> >fields into a new stack.
> >
> >So rather than show XYZ data progressing in time, it takes an XYT stack
> >(two spatial dimensions and a time dimension), adds a (redundant) 3rd
> >dimension reflecting the intensity of the slice's pixels, and puts the
> >result into another XYT stack.
> >
> >Am I wrong?
>
> Yes I think you have misunderstood the process.

Well, I don't think so.

> The macro takes one XY image at a time,

That's what I am saying.

> submits it to the Interactive 3D viewer,

Except that it is the Interactive Surface Plot, which makes a height field
out of a 2D image.  What I said (actually I said that it adds a 3rd
dimension -- the height -- from the intensity of the pixels, but that the
same thing).

> and the result is an XYZ image for that time point.

As you say "time point" here, you agree that the slices (XY) you take from
the stack are actually from different times (T), not depth (Z).

So you are taking an XYT stack as input, not XYZ.

> This image is placed on a new stack. Then it takes the next image from
> the stack of XY images (which represents the next point in time) and
> creates an XYZ image for that time point and adds it to the new stack.

Except that it is not really XYZ.  It is a projection of the height-field
of a 2D image.  Which is two-dimensional.

So basically you constructed another 2D image from an original 2D image.
 
> The resulting new stack is an XYZT stack, allowing you to animate the
> XYZ images that are constructed from the original XY data.

As you have no control from which viewpoint you are looking at your data,
it is essentially an XYT stack.

If I understood Aryeh correctly, what he wants is to visualize 3D stacks
(XYZ, i.e some recordings of a confocal microscope or some such, where you
have slices for different z coordinates), and he has several 3D stacks
recorded from the same specimen taken at different time points.

So this means that he has an XYZT hyperstack.

And he wants to see a 3D visualization (volume rendering, thresholded
surface, or something like that) over time, and while it loops through the
time steps, he wants to turn it around interactively (meaning
rotating/moving the specimen around, all the while it is looping through
the time steps).

I might be utterly wrong about what Aryeh meant, but I am certain that
Benjamin meant that, because I saw the 4D stuff in the 3D viewer in
action, and it is pretty awesome.

Think a single cell, going through mitosis, being recorded in 3D, and you
can now see it in 3D, zooming in while it is developing, rotating it so
you get a better view.

It's definitely absolutely awesome,
Dscho
Reply | Threaded
Open this post in threaded view
|

Re: XYZT visualization

Philip Ershler
On Jan 20, 2009, at 4:35 PM, Johannes Schindelin wrote:

> Hi,
>
> On Tue, 20 Jan 2009, Philip Ershler wrote:
>
>> On Jan 20, 2009, at 2:39 PM, Johannes Schindelin wrote:
>>
>>> On Tue, 20 Jan 2009, Philip Ershler wrote:
>>>
>>>> Here is a macro although fairly basic, does the job. It takes a
>>>> stack of images and creates a stack of 3D images. Just setup the
>>>> Interactive 3D viewer with the view and other settings that you
>>>> want. Then execute this macro.
>>>
>>> How does that give you a time axis in the 3D viewer?
>>>
>>> AFAICT it takes all the slices of the current stack, one by one,  
>>> turns
>>> them into height fields _individually_, and then puts those height
>>> fields into a new stack.
>>>
>>> So rather than show XYZ data progressing in time, it takes an XYT  
>>> stack
>>> (two spatial dimensions and a time dimension), adds a (redundant)  
>>> 3rd
>>> dimension reflecting the intensity of the slice's pixels, and puts  
>>> the
>>> result into another XYT stack.
>>>
>>> Am I wrong?
>>
>> Yes I think you have misunderstood the process.
>
> Well, I don't think so.
>
>> The macro takes one XY image at a time,
>
> That's what I am saying.
>
>> submits it to the Interactive 3D viewer,
>
> Except that it is the Interactive Surface Plot, which makes a height  
> field
> out of a 2D image.  What I said (actually I said that it adds a 3rd
> dimension -- the height -- from the intensity of the pixels, but  
> that the
> same thing).
>
>> and the result is an XYZ image for that time point.
>
> As you say "time point" here, you agree that the slices (XY) you  
> take from
> the stack are actually from different times (T), not depth (Z).
>
> So you are taking an XYT stack as input, not XYZ.
>
>> This image is placed on a new stack. Then it takes the next image  
>> from
>> the stack of XY images (which represents the next point in time) and
>> creates an XYZ image for that time point and adds it to the new  
>> stack.
>
> Except that it is not really XYZ.  It is a projection of the height-
> field
> of a 2D image.  Which is two-dimensional.
>
> So basically you constructed another 2D image from an original 2D  
> image.
>
>> The resulting new stack is an XYZT stack, allowing you to animate the
>> XYZ images that are constructed from the original XY data.
>
> As you have no control from which viewpoint you are looking at your  
> data,
> it is essentially an XYT stack.
>
> If I understood Aryeh correctly, what he wants is to visualize 3D  
> stacks
> (XYZ, i.e some recordings of a confocal microscope or some such,  
> where you
> have slices for different z coordinates), and he has several 3D stacks
> recorded from the same specimen taken at different time points.
>
> So this means that he has an XYZT hyperstack.
>
> And he wants to see a 3D visualization (volume rendering, thresholded
> surface, or something like that) over time, and while it loops  
> through the
> time steps, he wants to turn it around interactively (meaning
> rotating/moving the specimen around, all the while it is looping  
> through
> the time steps).

OK, if that's what the OP is after, then what I've put up ain't it.  
But if
you want to interactively pick a 3D view and then make an animation of
that view, then the macro does it.


Thanks


>
>
> I might be utterly wrong about what Aryeh meant, but I am certain that
> Benjamin meant that, because I saw the 4D stuff in the 3D viewer in
> action, and it is pretty awesome.
>
> Think a single cell, going through mitosis, being recorded in 3D,  
> and you
> can now see it in 3D, zooming in while it is developing, rotating it  
> so
> you get a better view.
>
> It's definitely absolutely awesome,
> Dscho
Reply | Threaded
Open this post in threaded view
|

Re: XYZT visualization

Aryeh Weiss
In reply to this post by dscho
Johannes Schindelin wrote:

>
> If I understood Aryeh correctly, what he wants is to visualize 3D stacks
> (XYZ, i.e some recordings of a confocal microscope or some such, where you
> have slices for different z coordinates), and he has several 3D stacks
> recorded from the same specimen taken at different time points.
>
> So this means that he has an XYZT hyperstack.
>
> And he wants to see a 3D visualization (volume rendering, thresholded
> surface, or something like that) over time, and while it loops through the
> time steps, he wants to turn it around interactively (meaning
> rotating/moving the specimen around, all the while it is looping through
> the time steps).
>

Yes -- this is exactly what I meant. I already have the XYZT hyperstack.
It would really be nice to be able to use the hyperstack as the input to the
volume visualization program.

--aryeh
--
Aryeh Weiss
School of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384050
Reply | Threaded
Open this post in threaded view
|

Re: XYZT visualization

dscho
Dear Aryeh,

On Wed, 21 Jan 2009, Aryeh Weiss wrote:

> Johannes Schindelin wrote:
> >
> > If I understood Aryeh correctly, what he wants is to visualize 3D
> > stacks (XYZ, i.e some recordings of a confocal microscope or some
> > such, where you have slices for different z coordinates), and he has
> > several 3D stacks recorded from the same specimen taken at different
> > time points.
> >
> > So this means that he has an XYZT hyperstack.
> >
> > And he wants to see a 3D visualization (volume rendering, thresholded
> > surface, or something like that) over time, and while it loops through
> > the time steps, he wants to turn it around interactively (meaning
> > rotating/moving the specimen around, all the while it is looping
> > through the time steps).
>
> Yes -- this is exactly what I meant. I already have the XYZT hyperstack.
> It would really be nice to be able to use the hyperstack as the input to
> the volume visualization program.

As Bene said he is motivated to work on it again, I think support for this
is not far away :-)  After all, the 3D viewer can already read a number of
stacks from a directory, so it should be a matter of detecting that the
user specified a file instead of a directory, and then just a little more
code to handle the hyperstack.

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

Re: XYZT visualization

Benjamin Schmid-2
In reply to this post by Aryeh Weiss
Hi Aryeh,

> Thank you for your reply. This works, although getting the files written
> out is a bit of a pain. It can be done in a macro, but the names have to
> be parsed to get the order correct. What would really be nice is if one
> could load a hyperstack directly into the volume viewer. That would save
> a lot of bookkeeping.

I just uploaded a new version of the 3D viewer. Again following -> File
-> Load 4D data, you can load 4D data. You can now eiter specify a
folder which contains your 3D images, or a file containing a hyperstack.

If you select a folder, first all filenames are sorted alphabetically,
and then each file is loaded, if possible (if not, it's omitted).

That's the first time I used hyperstacks, so it may well be that I've
done something stupid. Until now, the specified hyperstack is expected
to have only one channel, and that its frames correspond to the time points.
Let me know if it works.

Cheers,
Benjamin
Reply | Threaded
Open this post in threaded view
|

Re: XYZT visualization

Michael Doube
Bene,

Are you posting new versions of the ImageJ 3D viewer to the neurofly page
http://132.187.25.13/home/?category=Download&page=Viewer3D

Or somewhere else?

Mike

Benjamin Schmid wrote:

> Hi Aryeh,
>
>> Thank you for your reply. This works, although getting the files written
>> out is a bit of a pain. It can be done in a macro, but the names have to
>> be parsed to get the order correct. What would really be nice is if one
>> could load a hyperstack directly into the volume viewer. That would save
>> a lot of bookkeeping.
>
> I just uploaded a new version of the 3D viewer. Again following -> File
> -> Load 4D data, you can load 4D data. You can now eiter specify a
> folder which contains your 3D images, or a file containing a hyperstack.
>
> If you select a folder, first all filenames are sorted alphabetically,
> and then each file is loaded, if possible (if not, it's omitted).
>
> That's the first time I used hyperstacks, so it may well be that I've
> done something stupid. Until now, the specified hyperstack is expected
> to have only one channel, and that its frames correspond to the time points.
> Let me know if it works.
>
> Cheers,
> Benjamin

--
Dr Michael Doube  BPhil BVSc PhD MRCVS
Research Associate
Department of Bioengineering
Imperial College London
South Kensington Campus
London  SW7 2AZ
United Kingdom
Reply | Threaded
Open this post in threaded view
|

Re: XYZT visualization

Benjamin Schmid-2
Hi Mike,

> Are you posting new versions of the ImageJ 3D viewer to the neurofly page
> http://132.187.25.13/home/?category=Download&page=Viewer3D

Yes, have you given it a try? Did it work?

Cheers,
Bene

>
> Or somewhere else?
>
> Mike
>
> Benjamin Schmid wrote:
>> Hi Aryeh,
>>
>>> Thank you for your reply. This works, although getting the files
>>> written out is a bit of a pain. It can be done in a macro, but the
>>> names have to be parsed to get the order correct. What would really
>>> be nice is if one could load a hyperstack directly into the volume
>>> viewer. That would save a lot of bookkeeping.
>>
>> I just uploaded a new version of the 3D viewer. Again following -> File
>> -> Load 4D data, you can load 4D data. You can now eiter specify a
>> folder which contains your 3D images, or a file containing a hyperstack.
>>
>> If you select a folder, first all filenames are sorted alphabetically,
>> and then each file is loaded, if possible (if not, it's omitted).
>>
>> That's the first time I used hyperstacks, so it may well be that I've
>> done something stupid. Until now, the specified hyperstack is expected
>> to have only one channel, and that its frames correspond to the time points.
>> Let me know if it works.
>>
>> Cheers,
>> Benjamin
>
> --
> Dr Michael Doube  BPhil BVSc PhD MRCVS
> Research Associate
> Department of Bioengineering
> Imperial College London
> South Kensington Campus
> London  SW7 2AZ
> United Kingdom
12