Login  Register

Re: Access File Info in macro?

Posted by Krs5 on Jul 23, 2013; 7:46am
URL: http://imagej.273.s1.nabble.com/Access-File-Info-in-macro-tp5004079p5004086.html

Dear Mark,


Do you mean you want to be able to change the offset value manually? For that you can use the code below
mOffset = 52840;
Dialog.create("Offset");
        Dialog.addNumber("Give an offset value", mOffset);
Dialog.show();
mOffset = Dialog.getNumber();

Best wishes

Kees


Dr Ir K.R. Straatman
Senior Experimental Officer
Centre for Core Biotechnology Services
University of Leicester

http://www.le.ac.uk/biochem/microscopy/home.html


-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of xchopp
Sent: 22 July 2013 21:15
To: [hidden email]
Subject: Access File Info in macro?

My macro code:

run("Raw...", "open="+path+infile+" image=[16-bit Unsigned] width="+srcCols+" height="+Wsize+" offset="+mOffset+" number="+NumChunks+"
gap=0 little-endian use");

must be preceded by a line in which the offset is hardwired, thus:
 
mOffset = 52840;      

This is pretty inelegant: is there any way I can access the offset value from ImageJ macro language?  If not, is there a Javascript function that I can call from the macro to do the same (and how to call?).  

Cheers!

--Mark    





--
View this message in context: http://imagej.1557.x6.nabble.com/Access-File-Info-in-macro-tp5004079.html
Sent from the ImageJ mailing list archive at Nabble.com.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html