Reslice from line selection...

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

Reslice from line selection...

Michael Cundell
Hello.

Im sorry I have another question about reslice.  When using the reslice tool with a line selection and the slice count set to lets say 10, in the image the line becomes a rectangular box.  I was presuming that box defined the boundaries of the reslice, as is the case when you make a rectangular selection.  However, when i start the reslice the lines go beyond that box.

Im working with a deltavision file.  I am still unsure of what I should be setting the input and output spacing at for a 1:1 representation of my image data that is biologically relevent but I dont want to hassle the list about this but did want one last attempt to try and find an answer (sorry !).  I just chose 0.11 micron input and output spacing as this is the width of a single pixel as measured by the deltavision microscopes own software and also when selecting a single pixel with the rectangular selection in imageJ the h and w values are 0.11.  However, changing this input and output spacing also effects how far beyond the box the lines go when reslicing from a line selection so it may be relevent to this question.

Basically I have 20 line ROIs selected in an image and want to make a macro to reslice them and create max intensity z-projections.  I just need to make sure that in the macro i set the slice count to something that will cover the region im interested in and not go too far beyond that or it will start reslicing other cells and im trying to slice something from a single cell.

Any help would be appreciated.

Thanks !

Mike
Reply | Threaded
Open this post in threaded view
|

Re: Reslice from line selection...

Michael Cundell
Sorry my response to wayne did not go to the list So I included it below.
v1.42 does not give me this problem and the lines do not go beyond the boundary of the box.  Has the input and output spacing been replaced with just "line spacing" as there is now only one box for that?  

Now using v1.42 I have tried to use the macro recorder to record a macro  but with no luck.  Can someone help me out with a macro for loading one of 20 ROIs in the ROI manager, reslicing it (0.1103 input and output spacing and a slice count of 50) and then creating a max projection of that and then saving the MAX projection as a TIFF, then close the reslice and max intensity of the reslice windows and then move on to the next ROI and do the same.  Then I should be left with a folder that contains my Max intensity projections of the reslices.  

I have no idea what im doing but I tried anyway by using the macro recorder for myself and came up with:

roiManager("Select", 0);
run("Reslice [/]...", "slice=0.1103 slice=50 rotate");
selectWindow("Reslice of SSC789_timelapse_01_R3D_D3D");
run("Z Project...", "start=1 stop=50 projection=[Max Intensity]");
saveAs("Tiff", "/data1/roi0.tif");
close();
close();

I was going to just copy and paste that 20 times and change the roiManager select numbers and increment the .tif file name  because I have no idea how to automate that.  But anyway, that macro alone doesnt work as it tells me that "Output Z-spacing (1pixels) is too large" when I try to run it.  When recording the macro I did get an error from the macro recorder saying:

Duplicate keyword:
command: "Reslice [/]
Keyword: "slice"
Value: 1
add an underscore to the corresponding label in the dialog to make the first word unique.

Thanks

Mike



---------------------------
Hi,
 
I am using imageJ run on CentOS linux v1.41o which had the problem.  I just
checked using my laptop which has v1.40g running on windows XP and that had
the same problem using a different deltavision image that was only 126MB
instead of the 2.6GB file i was opening in CentOS.  However, I just updated
to v1.42 on my laptop by downloading ij.jar from
http://rsbweb.nih.gov/ij/upgrade/index.html and overwritting my old ij.jar
and the problem is now gone.  Sorry I should have tried upgrading first.
 
All I was doing was drawing a line in my deltavision file, then reslice with
0.11micron input and output and a slice count of 10 (although all slice
counts i tried the lines went beyond the box).  It was the same on both
versions of imageJ mentioned previously on separate machines with different
OS's.
 
Anyway, hopefully problem solved.  I will go upgrade the linux computers
imageJ and try that.  Should work
 
Thanks
 
Mike
 
 

_________________________________________________________________
View your Twitter and Flickr updates from one place – Learn more!
http://clk.atdmt.com/UKM/go/137984870/direct/01/
Reply | Threaded
Open this post in threaded view
|

Re: Reslice from line selection...

Wayne Rasband
Here is macro that, for each line selection in the ROI Manager,
re-slices using a count of 50, does a Max Intensity projection and
saves the projection in TIFF format. The slice spacing is determined by
the Voxel Depth set in the Image>Properties dialog box. You will need
to use the Help>Update ImageJ command to update to the v1.42n daily
build, which fixes a bug in the Reslice command that caused it to
record duplicate keywords (e.g., "slice=0.11 slice=50").

    setBatchMode(true);
    dir = getDirectory("Choose a Directory");
    n = roiManager("count");
    for (i=0; i<n; i++) {
        roiManager("Select", i);
        run("Reslice [/]...", "slice_count=50 rotate");
        id = getImageID;
        run("Z Project...", "projection=[Max Intensity]");
        saveAs("Tiff", dir+i+".tif");
        close();
        selectImage(id);
        close();
     }

-wayne

On Apr 24, 2009, at 3:24 PM, rstj srejt wrote:

> Sorry my response to wayne did not go to the list So I included it
> below.
> v1.42 does not give me this problem and the lines do not go beyond the
> boundary of the box.  Has the input and output spacing been replaced
> with just "line spacing" as there is now only one box for that?
>
> Now using v1.42 I have tried to use the macro recorder to record a
> macro  but with no luck.  Can someone help me out with a macro for
> loading one of 20 ROIs in the ROI manager, reslicing it (0.1103 input
> and output spacing and a slice count of 50) and then creating a max
> projection of that and then saving the MAX projection as a TIFF, then
> close the reslice and max intensity of the reslice windows and then
> move on to the next ROI and do the same.  Then I should be left with a
> folder that contains my Max intensity projections of the reslices.
>
> I have no idea what im doing but I tried anyway by using the macro
> recorder for myself and came up with:
>
> roiManager("Select", 0);
> run("Reslice [/]...", "slice=0.1103 slice=50 rotate");
> selectWindow("Reslice of SSC789_timelapse_01_R3D_D3D");
> run("Z Project...", "start=1 stop=50 projection=[Max Intensity]");
> saveAs("Tiff", "/data1/roi0.tif");
> close();
> close();
>
> I was going to just copy and paste that 20 times and change the
> roiManager select numbers and increment the .tif file name  because I
> have no idea how to automate that.  But anyway, that macro alone
> doesnt work as it tells me that "Output Z-spacing (1pixels) is too
> large" when I try to run it.  When recording the macro I did get an
> error from the macro recorder saying:
>
> Duplicate keyword:
> command: "Reslice [/]
> Keyword: "slice"
> Value: 1
> add an underscore to the corresponding label in the dialog to make the
> first word unique.
>
> Thanks
>
> Mike
>
>
>
> ---------------------------
> Hi,
>
> I am using imageJ run on CentOS linux v1.41o which had the problem.  I
> just
> checked using my laptop which has v1.40g running on windows XP and
> that had
> the same problem using a different deltavision image that was only
> 126MB
> instead of the 2.6GB file i was opening in CentOS.  However, I just
> updated
> to v1.42 on my laptop by downloading ij.jar from
> http://rsbweb.nih.gov/ij/upgrade/index.html and overwritting my old
> ij.jar
> and the problem is now gone.  Sorry I should have tried upgrading
> first.
>
> All I was doing was drawing a line in my deltavision file, then
> reslice with
> 0.11micron input and output and a slice count of 10 (although all slice
> counts i tried the lines went beyond the box).  It was the same on both
> versions of imageJ mentioned previously on separate machines with
> different
> OS's.
>
> Anyway, hopefully problem solved.  I will go upgrade the linux
> computers
> imageJ and try that.  Should work
>
> Thanks
>
> Mike
>
>
>
> _________________________________________________________________
> View your Twitter and Flickr updates from one place – Learn more!
> http://clk.atdmt.com/UKM/go/137984870/direct/01/
Reply | Threaded
Open this post in threaded view
|

Re: Reslice from line selection...

Michael Cundell
Thanks so much for your help wayne... that will save me so much time it is
untrue !

I hope my uselessness has been of some help also in identifying some
problems.

Cheers

Mike

----- Original Message -----
From: "Wayne Rasband" <[hidden email]>
To: <[hidden email]>
Sent: Friday, April 24, 2009 9:43 PM
Subject: Re: Reslice from line selection...


Here is macro that, for each line selection in the ROI Manager,
re-slices using a count of 50, does a Max Intensity projection and
saves the projection in TIFF format. The slice spacing is determined by
the Voxel Depth set in the Image>Properties dialog box. You will need
to use the Help>Update ImageJ command to update to the v1.42n daily
build, which fixes a bug in the Reslice command that caused it to
record duplicate keywords (e.g., "slice=0.11 slice=50").

    setBatchMode(true);
    dir = getDirectory("Choose a Directory");
    n = roiManager("count");
    for (i=0; i<n; i++) {
        roiManager("Select", i);
        run("Reslice [/]...", "slice_count=50 rotate");
        id = getImageID;
        run("Z Project...", "projection=[Max Intensity]");
        saveAs("Tiff", dir+i+".tif");
        close();
        selectImage(id);
        close();
     }

-wayne

On Apr 24, 2009, at 3:24 PM, rstj srejt wrote:

> Sorry my response to wayne did not go to the list So I included it below.
> v1.42 does not give me this problem and the lines do not go beyond the
> boundary of the box.  Has the input and output spacing been replaced with
> just "line spacing" as there is now only one box for that?
>
> Now using v1.42 I have tried to use the macro recorder to record a macro
> but with no luck.  Can someone help me out with a macro for loading one of
> 20 ROIs in the ROI manager, reslicing it (0.1103 input and output spacing
> and a slice count of 50) and then creating a max projection of that and
> then saving the MAX projection as a TIFF, then close the reslice and max
> intensity of the reslice windows and then move on to the next ROI and do
> the same.  Then I should be left with a folder that contains my Max
> intensity projections of the reslices.
>
> I have no idea what im doing but I tried anyway by using the macro
> recorder for myself and came up with:
>
> roiManager("Select", 0);
> run("Reslice [/]...", "slice=0.1103 slice=50 rotate");
> selectWindow("Reslice of SSC789_timelapse_01_R3D_D3D");
> run("Z Project...", "start=1 stop=50 projection=[Max Intensity]");
> saveAs("Tiff", "/data1/roi0.tif");
> close();
> close();
>
> I was going to just copy and paste that 20 times and change the roiManager
> select numbers and increment the .tif file name  because I have no idea
> how to automate that.  But anyway, that macro alone doesnt work as it
> tells me that "Output Z-spacing (1pixels) is too large" when I try to run
> it.  When recording the macro I did get an error from the macro recorder
> saying:
>
> Duplicate keyword:
> command: "Reslice [/]
> Keyword: "slice"
> Value: 1
> add an underscore to the corresponding label in the dialog to make the
> first word unique.
>
> Thanks
>
> Mike
>
>
>
> ---------------------------
> Hi,
>
> I am using imageJ run on CentOS linux v1.41o which had the problem.  I
> just
> checked using my laptop which has v1.40g running on windows XP and that
> had
> the same problem using a different deltavision image that was only 126MB
> instead of the 2.6GB file i was opening in CentOS.  However, I just
> updated
> to v1.42 on my laptop by downloading ij.jar from
> http://rsbweb.nih.gov/ij/upgrade/index.html and overwritting my old ij.jar
> and the problem is now gone.  Sorry I should have tried upgrading first.
>
> All I was doing was drawing a line in my deltavision file, then reslice
> with
> 0.11micron input and output and a slice count of 10 (although all slice
> counts i tried the lines went beyond the box).  It was the same on both
> versions of imageJ mentioned previously on separate machines with
> different
> OS's.
>
> Anyway, hopefully problem solved.  I will go upgrade the linux computers
> imageJ and try that.  Should work
>
> Thanks
>
> Mike
>
>
>
> _________________________________________________________________
> View your Twitter and Flickr updates from one place – Learn more!
> http://clk.atdmt.com/UKM/go/137984870/direct/01/