Posted by
Michael Cundell on
Apr 25, 2009; 9:28am
URL: http://imagej.273.s1.nabble.com/Reslice-from-line-selection-tp3692795p3692798.html
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/