Is there a way to do a reslice of an image stack at some
arbitrary angle in the Z axis? I understand that reslice allows you to draw a line in the XY plane of a stack and create a new slice orthogonal to that plane. I want to reslice in various angles in the Z axis. I realize this can be computationally intensive, but I will be doing this on small cropped stacks on a 64 bit quad core system. Bob Nienhuis UCLA / VA Medical Center |
You might look at Reorient3_TP, http://www.med.harvard.edu/JPNM/ij/plugins/Reorient3TP.html
. It may be more general than you are looking for, but I think it will do what you want. It is part of an "Align Stacks" package, http://www.med.harvard.edu/JPNM/ij/plugins/ . The Alignment plugin has a manual which explains how it works. Several of the operations are the same or similar. Tony J. Anthony Parker, MD PhD [hidden email] tel 617 667-5250 fax -2185 comp -5275 page 617 632-7243 #31978 330 Brookline Ave, Boston, MA, 02215-5400 On Jan 7, 2009, at 2:56 PM, Bob Nienhuis wrote: > Is there a way to do a reslice of an image stack at some > arbitrary angle in the Z axis? > > I understand that reslice allows you to draw a line > in the XY plane of a stack and create a new > slice orthogonal to that plane. > > I want to reslice in various angles in the Z axis. > > I realize this can be computationally intensive, > but I will be doing this on small cropped stacks > on a 64 bit quad core system. > > Bob Nienhuis > UCLA / VA Medical Center > |
In reply to this post by Bob Nienhuis
Hi Bob,
I wrote a program called VisBio that can do this. To help you out, I have adapted it into an ImageJ plugin that you can use for arbitrary slicing. You can download the plugin here: http://www.loci.wisc.edu/software/visbio-arbitrary-slicer.zip Unzip the archive into your ImageJ plugins folder. Next time you run ImageJ, there will be a new VisBio submenu with an "Arbitrary Slicer" item. This plugin comes with a number of caveats: 1) The bundle is quite large (>5MB zipped, >10MB uncompressed). 2) Like several other 3D plugins for ImageJ, this plugin requires Java3D. If you have Mac OS X, you're already got it. If you have Windows or Linux, you can download and install Java3D from: https://java3d.dev.java.net/binary-builds.html 3) I hacked this together really quickly based on my latest VisBio source, and it is not well integrated with ImageJ. You need to specify a file on disk to load, and it may not work with every file format. It should work with most of the ones supported by Bio-Formats, though. 4) It will take an obnoxiously long time to load. Expect to wait >60 seconds for VisBio to start up, do some preloading, read your dataset, construct the slice, construct the display, and load the data into the display. However, once it's ready, it should be pretty snappy on a reasonably modern machine. 5) You can take a screenshot of the slice either using the Capture tab, or just using your OS'es screen capture facility. I have been planning to integrate VisBio into ImageJ better at some point, but have not had time or funding to do so. Eventually I hope to refactor VisBio from a big honkin' standalone program into a suite of ImageJ plugins, though. :-) Since this plugin is essentially a bundle of VisBio in its entirety, there is a lot of power: * In the arbitrary slice controls, first select your yaw, pitch and location. You should get a realtime (but blocky) view of your slice when moving these around. When ready, crank the Resolution slider up to max to get the best quality slice. If you want to move the slice around again after that, though, either turn down the resolution again or uncheck the "recompute slice on the fly" checkbox. * You can overlay the original image stack by clicking the "Data" tab in the display controls, selecting your dataset filename in the list, then using "Visible" checkbox and "Toggle slices" button to control which slices are shown. * You can control the colors by selecting your dataset and clicking the "Colors" button. * Rotate the display by dragging with the right mouse button. Zoom by holding Shift, and pan by holding Control. * You can navigate between timepoints and channels in your dataset (if any) using the sliders on the bottom right of the display. * There are tons of other features, which you can read about using VisBio's built in manual accessible from the Help menu. Hope that helps, and let me know if you have any questions! -Curtis On Wed, Jan 7, 2009 at 1:56 PM, Bob Nienhuis <[hidden email]> wrote: > Is there a way to do a reslice of an image stack at some > arbitrary angle in the Z axis? > > I understand that reslice allows you to draw a line > in the XY plane of a stack and create a new > slice orthogonal to that plane. > > I want to reslice in various angles in the Z axis. > > I realize this can be computationally intensive, > but I will be doing this on small cropped stacks > on a 64 bit quad core system. > > Bob Nienhuis > UCLA / VA Medical Center > |
In reply to this post by Bob Nienhuis
Dear Bob,
That is under Image/Stacks/Reslice Select a line tool, draw your line ROI, then invoke the command. Also the hotkey is "/". You are not limited to a straightline selection. Creating a rectangular box ROI allows reslicing from top, bottom, left, right to create an orthogonal stack. There is a plugin for cutting planes, but don't have the name at hand. Do a search in the listserv archives. Regards, Glen On Jan 7, 2009, at 9:00 PM, IMAGEJ automatic digest system wrote: > From: Bob Nienhuis <[hidden email]> > Date: January 7, 2009 11:56:01 AM PST > Subject: Reslice stack at various angles > > > Is there a way to do a reslice of an image stack at some > arbitrary angle in the Z axis? > > I understand that reslice allows you to draw a line > in the XY plane of a stack and create a new > slice orthogonal to that plane. > > I want to reslice in various angles in the Z axis. > > I realize this can be computationally intensive, > but I will be doing this on small cropped stacks > on a 64 bit quad core system. > > Bob Nienhuis > UCLA / VA Medical Center |
In reply to this post by ctrueden
We are having a problem with using global variables in macros. A var declaration
at the beginning of the macro file seems to cause everything to hang. For example, here is a small macro copied from a previous posting on the subject: //================ var x; macro "test" { x=10; f(); print (x); exit("Terminating normally..."); } function f(){ x = 20; } //================= If I omit var x; declaration, then it runs fine (but of course it prints that x is 10, as expected). If I include the var x; declaration, then it hangs. I ran it with the debugger and single step. It advances past the var declaration and highlights the macro "test" { line. There it stops (ie, cntl-E will not advance operation to the next line). It seems something obvious that I missed. I did not find this problem in the archives. --aryeh -- Aryeh Weiss School of Engineering Bar Ilan University Ramat Gan 52900 Israel Ph: 972-3-5317638 FAX: 972-3-7384050 |
Hi Aryeh,
as far as I understand it, global variables work with installed macros only, not if you use "run macro" form a text window. Your test macro works well if you install it. Use Macros>Install Macros in the text window's menu or ctrl-i (Mac: cmd-i) Michael ________________________________________________________________ On 14 Jan 2009, at 11:58, Aryeh Weiss wrote: > We are having a problem with using global variables in macros. A > var declaration at the beginning of the macro file seems to cause > everything to hang. > > For example, here is a small macro copied from a previous posting > on the subject: > > //================ > > var x; > > macro "test" { > x=10; > f(); > print (x); > exit("Terminating normally..."); > } > > function f(){ > x = 20; > } > > //================= > > If I omit var x; declaration, then it runs fine (but of course it > prints > that x is 10, as expected). > > If I include the var x; declaration, then it hangs. I ran it with > the debugger and single step. It advances past the var declaration > and highlights the > macro "test" { line. There it stops (ie, cntl-E will not advance > operation to the next line). > > It seems something obvious that I missed. I did not find this > problem in the archives. > > --aryeh > -- > Aryeh Weiss > School of Engineering > Bar Ilan University > Ramat Gan 52900 Israel > > Ph: 972-3-5317638 > FAX: 972-3-7384050 > |
In reply to this post by Aryeh Weiss
This bug is fixed in the ImageJ 1.42h daily build. Pressing ctrl-r
(Macros>Run Macro) in the macro editor now runs the first macro in a macro set regardless of whether or not there are global variables. This means you can now also debug the first macro in a macro set by pressing ctrl-d (Debug>Debug Macro) and single step through the code by pressing ctrl-e (Debug>Step). On the Mac you can debug any macro in a macro set by running it from the Macros menu with the alt key down. This does not work on Windows because of a Java bug. -wayne On Jan 15, 2009, at 3:05 PM, Wayne Rasband wrote: > We are having a problem with using global variables in macros. A var > declaration > at the beginning of the macro file seems to cause everything to hang. > > For example, here is a small macro copied from a previous posting on > the subject: > > //================ > > var x; > > macro "test" { > x=10; > f(); > print (x); > exit("Terminating normally..."); > } > > function f(){ > x = 20; > } > > //================= > > If I omit var x; declaration, then it runs fine (but of course it > prints > that x is 10, as expected). > > If I include the var x; declaration, then it hangs. I ran it with the > debugger > and single step. It advances past the var declaration and highlights > the > macro "test" { line. There it stops (ie, cntl-E will not advance > operation to > the next line). > > It seems something obvious that I missed. I did not find this problem > in the > archives. > > --aryeh > -- > Aryeh Weiss > School of Engineering > Bar Ilan University > Ramat Gan 52900 Israel > > Ph: 972-3-5317638 > FAX: 972-3-7384050 > |
Free forum by Nabble | Edit this page |