Loading data
finn
At the moment I use the following code:
String Text1= “C:...:image1.tif" //define image path
ImageLoad/T=tiff/C=-1/LR3D Text1 //load the image
String Text1=”image1.tif” //define name of the wave to access it via wave
Make/O/N=(5,5,7) wave1=0 //build framework for dataset to be loaded
wave wave1=$T0
For me this seems quite complicated for just loading a dataset. But regardless of this it is even more annoying that I have to define the exact size in pixel of the image to be loaded. With DimSize I could determine the size in pixel but for this the wave has to be accessed via wave beforehand. And this – at least with my code - requires to provide a framework wave (wave1) with the image size.
Does anybody know a solution to this?
Thank you,
Finn
String path // Path to TIFF file
ImageLoad/T=tiff/C=-1/LR3D path //load the image
if (V_flag == 0)
Print "ImageLoad failed"
return -1
endif
String name = StringFromList(0, S_waveNames) // Name of loaded wave
Wave w = $name // Reference to loaded wave
Variable numRows = DimSize(w, 0)
Variable numColumns = DimSize(w, 1)
Print name, numRows, numColumns
return 0 // Success
End
October 2, 2012 at 11:25 am - Permalink
Thank you,
Finn
October 4, 2012 at 05:08 am - Permalink
A wave reference is just that, a reference. It is a name that points to an existing wave. for instance if you do
w+=1
We are manipulating wave0. w is simply a temporary name that is used in the code
October 4, 2012 at 07:19 am - Permalink