
displaying slices from a 3D wave

daggaz
duplicate/O/R=[][][z] 3D_wave 2D_wave newimage 2D_wave
which seems obtuse considering the data already exists, but I cant seem to quickly call up the slice in any other way. What is the correct method here? Eventually I want to make a function which loads the image and uses a slider to move thru them (half way there)..
is another method. Replace the [0] with the z-layer index you want. It should save you the frequent Duplicate operation once you have created your 2D destination wave. It's too bad that the general purpose MatrixOP operation does not seem to handle this case.
May 10, 2013 at 07:13 am - Permalink
Even then, would be nice not to have to go thru the hoops, something like
display; appendimage 3D_wave[][][z]
or better
newimage 3D_wave[][][z]
May 10, 2013 at 08:34 am - Permalink
When you make a new wave (whether using Duplicate or Make), Igor copies the data.
Along with the approaches already mentioned, you can use the ImageTransform operation with the getPlane keyword and then rename the M_ImagePlane output wave that the operation creates. You should use either ImageTransform or the Duplicate command you originally posted as those should be faster than using a wave assignment statement.
You can display a 1-D subrange of a wave using the Display operation, but subrange display isn't supported for images. However, if you are just trying to change the plane of a wave that is displayed in an image, use the ModifyImage operation with the plane keyword. Please read the documentation for this keyword to understand exactly what we mean by "plane".
There is also a package that adds a plane slider to an image. To get this, select an image, then select the Analysis->Packages->Image Processing menu item. This will #include the image processing procedures and compile them. Once that happens, then select the Image->Add Slider menu item.
May 10, 2013 at 08:27 am - Permalink
Otherwise, I thought I had the slider figured out, but no (ive done other buttons with few problems).
My main function initiates wave names based on a single variable laser, then starts a panel/subpanel and puts up the first graphs, as well as loads a slider. The slider should move thru the variable z, which affects which graphs get put into the subpanels. My problem is that I cant seem to pass any variables, waves, or strings to the slider proc function, and I dont want to make the variables in this case global, because I expect this function to be run in multiple instances with similiar data sets in the same experiment. Is this even possible or am I going at it the wrong way entirely? In pseudo-code:
May 10, 2013 at 08:37 am - Permalink
1. If you load the Image Processing procedures (Analysis Menu->Packages->Image Processing) you will get an Image menu from which you can choose to add a slider to an image that displays a layer of a 3D wave or choose a 3D Wave display which presents all 3 orthogonal slices at once.
2. It may not be so obvious but the fastest way to scroll through the data (which does not involve duplication) is displaying orthogonal slices in Gizmo.
A.G.
WaveMetrics, Inc.
May 10, 2013 at 09:46 am - Permalink
a) Its good to know how it is done
b) There are other data types besides 3D stacks which such a function would be very useful for.
(I did think about stacking things regardless just to use the function, but what if it is x-scaled waves and not 2D images)
May 10, 2013 at 10:06 am - Permalink
It worked, but looked really glitchy, so I tried to incorporate the modifyimage trick, in order to avoid all the duplication steps, but now I am getting an error: there are no graphs or the graph does not exist.
I used the line
where the window path works using the display command, main_wave is name of the graph (thru a $string), and z is the value set by the slider. I also tried to replace main_wave with its string $main_wave_name but no dice. Any ideas?
May 10, 2013 at 02:53 pm - Permalink
Here is a full example:
This suggests that you check either the value you are passing for /W or the image instance.
I hope this helps,
AG
May 10, 2013 at 04:39 pm - Permalink
no matter how I try to code it, I get the first image up fine, then moving the slider kills the image and gives me the error.
also of strange note, the images looked very glitchy when i moved the slider so i tried adding the /live=0 flag to at least kill the intermediate images. now the slice_z image transitions extremely smoothly as i move the slider (using duplicate method) which is nice, but i thought this flag should stop all updates until the user has stopped moving the slider?? the two other graphs (not shown in this code, but different pre-existing waves being displayed according to z) are still glitchy tho.
May 12, 2013 at 05:52 am - Permalink
modifyimage/W=line_profile_main#graph_xy main_wave , plane=(z)
First, you need to specify the path to the graph displaying the image. The line above gives the host panel and subpanel, but not the graph. In your function PSF_slide(laser), you actually created a graph window in a subpanel. In this case the graph name seems to be "G0". So the window spec should be
/W=line_profile_main#graph_xy#G0
Second you need to give the image instance name. In this case it is stored in the string variable mainwave_name. So the image name is
$mainwave_name
Try this for the modifyimage command
modifyimage/W=line_profile_main#graph_xy#G0 $mainwave_name , plane=(z)
Finally comment out the line immediately above the line with modifyimage...
display/K=2/FG=(FL,FT,FR,FB)/Host=line_profile_main#graph_xy
This seems to be the cause of your image disappearing from the graph window.
Hope this is useful. Given my recent track record, this could be bogus advice.
May 12, 2013 at 01:11 pm - Permalink
May 12, 2013 at 01:31 pm - Permalink
Were you using $mainwave_name? If you tested modifyimage with "mainwave_name" or "mainwave", you would still receive an error, although slightly different from the one caused by the Win path.
PS Glad this worked for you.
May 12, 2013 at 01:56 pm - Permalink
Edit. Oh, I mean in the code. From the command line I used the actual wave name, of course, as the variables arent global in this case.
May 13, 2013 at 12:16 am - Permalink
Wave mainwave = $nameofmainwave
, then mainwave is a wave reference. That's a pointer to a wave, not something that can be used as a trace name.To understand the difference between traces and waves, consider that you can have waves, say wave0, with the same names in different data folders. The both result in a trace with the same name, wave0. If you put them both on the same graph, then you get two traces with names wave0 and wave0#1.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
May 13, 2013 at 09:56 am - Permalink