Loading data

I was wondering if there is an easier way to load a dataset into Igor for subsequent calculations.

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
I'm not sure what you are saying but I think you will find the answer in this example:
Function Demo(path)
    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

Ok, thank you. I was not aware that after referencing the wave via "w" can be accessed because it does not appear as wave in the data folder.

Thank you,
Finn
finn wrote:
Ok, thank you. I was not aware that after referencing the wave via "w" can be accessed because it does not appear as wave in the data folder.



A wave reference is just that, a reference. It is a name that points to an existing wave. for instance if you do

wave w = root:wave0
w+=1


We are manipulating wave0. w is simply a temporary name that is used in the code