Opening non-supported files with a macro

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Opening non-supported files with a macro

Gabriel Landini
Hi,
I am writing a macro to load images from a thermal imaging system.
I can import the data with the File>Import command but I want to have a macro
that will let me choose which file to open.

If I use the open() macro function, it expects to open a file in a supported
format, but of course I only want to get the file name through the file
chooser.

Is there a way to do this (get a non-supported file name using a file chooser)
with a macro (instead of a plugin)?

Thanks

Gabriel
Reply | Threaded
Open this post in threaded view
|

Grid_ Plugin

quantumlottie
I am wanting to do something very similar to the Grid_ plugin on the
website and was hoping seeing how it worked would help me.

However I just can't get Grid_ to run. I always get the error:  

Note: sun.tools.javac.Main has been deprecated.
C:\Program Files\ImageJ\plugins\Grid_.java:33: Interface DialogListener
of class Grid_ not found.
public class Grid_ implements PlugIn, DialogListener {
                                      ^
1 error, 1 warning

I'm sorry to ask a very basic question but I've tried a lot of things
and just don't know how to fix it. I have the latest version of ImageJ
as well....
Reply | Threaded
Open this post in threaded view
|

Re: Grid_ Plugin

Gabriel Landini
On Tuesday 10 July 2007 13:58:22 Holmes, Charlotte wrote:

> I am wanting to do something very similar to the Grid_ plugin on the
> website and was hoping seeing how it worked would help me.
>
> However I just can't get Grid_ to run. I always get the error:
>
> Note: sun.tools.javac.Main has been deprecated.
> C:\Program Files\ImageJ\plugins\Grid_.java:33: Interface DialogListener
> of class Grid_ not found.
> public class Grid_ implements PlugIn, DialogListener {
>                                       ^
> 1 error, 1 warning
>
> I'm sorry to ask a very basic question but I've tried a lot of things
> and just don't know how to fix it. I have the latest version of ImageJ
> as well....

What version is that? the latest jar file or the lastest install download?
(they are different things).

Have you tried to recompile the plugin?


Regards,
G.
Reply | Threaded
Open this post in threaded view
|

Re: Opening non-supported files with a macro

Michael Schmid
In reply to this post by Gabriel Landini
Hi Gabriel,

what about something like this:

   headerLength = 1024; //how many bytes to read initially to analyze  
the header
   run("Raw...", "image=8-bit height=1 offset=0 number=1 width="+
     headerLength); //asks the user for the file and reads the header
   path = "'"+getDirectory("image")+getTitle+"'";

   (... analyze header by reading the image as a byte array ...)

   run("Raw...", "open="+path+" image='32-bit Real' width="+width+
     " height="+height+" offset="+headerLength); //now really open  
the image


Michael
________________________________________________________________

On 10 Jul 2007, at 14:41, Gabriel Landini wrote:

> Hi,
> I am writing a macro to load images from a thermal imaging system.
> I can import the data with the File>Import command but I want to  
> have a macro
> that will let me choose which file to open.
>
> If I use the open() macro function, it expects to open a file in a  
> supported
> format, but of course I only want to get the file name through the  
> file
> chooser.
>
> Is there a way to do this (get a non-supported file name using a  
> file chooser)
> with a macro (instead of a plugin)?
>
> Thanks
>
> Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Grid_ Plugin

quantumlottie
In reply to this post by Gabriel Landini
It's the latest install download and I downloaded the compiler from the
suggested link on the ImageJ website.

I've recompiled it many times, I've restarted imagej, I've added many
things into the code and took other things out. I presume I have to add
something in as the error suggests something is missing. I have just run
out of ideas....



-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Gabriel Landini
Sent: 10 July 2007 14:14
To: [hidden email]
Subject: Re: Grid_ Plugin

On Tuesday 10 July 2007 13:58:22 Holmes, Charlotte wrote:
> I am wanting to do something very similar to the Grid_ plugin on the
> website and was hoping seeing how it worked would help me.
>
> However I just can't get Grid_ to run. I always get the error:
>
> Note: sun.tools.javac.Main has been deprecated.
> C:\Program Files\ImageJ\plugins\Grid_.java:33: Interface
DialogListener
> of class Grid_ not found.
> public class Grid_ implements PlugIn, DialogListener {
>                                       ^
> 1 error, 1 warning
>
> I'm sorry to ask a very basic question but I've tried a lot of things
> and just don't know how to fix it. I have the latest version of ImageJ
> as well....

What version is that? the latest jar file or the lastest install
download?
(they are different things).

Have you tried to recompile the plugin?


Regards,
G.
Reply | Threaded
Open this post in threaded view
|

Re: Grid_ Plugin

Gabriel Landini
On Tuesday 10 July 2007 14:41:26 Holmes, Charlotte wrote:
> It's the latest install download and I downloaded the compiler from the
> suggested link on the ImageJ website.

If it is the latest install download, it is not the "latest" version (which is
1.38x).

Please read this and update to the latest ij.jar file.

http://imagejdocu.tudor.lu/imagej-documentation-wiki/faq/how-do-i-update-imagej

Regards,

Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Opening non-supported files with a macro

Gabriel Landini
In reply to this post by Michael Schmid
On Tuesday 10 July 2007 14:31:06 Michael Schmid wrote:
> what about something like this:

Ah, yes, very clever and as a bonus I get the header loaded as well!  Great.
Thanks Michael!

Regards
Gabriel
Reply | Threaded
Open this post in threaded view
|

Re: Grid_ Plugin

Wayne Rasband
In reply to this post by quantumlottie
The updated, non-destructive Grid plugin at
<http://rsb.info.nih.gov/ij/plugins/grid.html> requires ImageJ 1.38u or
later,
available at <http://rsb.info.nih.gov/ij/notes.html>.

-wayne

On Jul 10, 2007, at 8:58 AM, Holmes, Charlotte wrote:

> I am wanting to do something very similar to the Grid_ plugin on the
> website and was hoping seeing how it worked would help me.
>
> However I just can't get Grid_ to run. I always get the error:
>
> Note: sun.tools.javac.Main has been deprecated.
> C:\Program Files\ImageJ\plugins\Grid_.java:33: Interface DialogListener
> of class Grid_ not found.
> public class Grid_ implements PlugIn, DialogListener {
>                                       ^
> 1 error, 1 warning
>
> I'm sorry to ask a very basic question but I've tried a lot of things
> and just don't know how to fix it. I have the latest version of ImageJ
> as well....
>
Reply | Threaded
Open this post in threaded view
|

Re: Grid_ Plugin

quantumlottie
Thanks

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
Wayne Rasband
Sent: 10 July 2007 14:56
To: [hidden email]
Subject: Re: Grid_ Plugin

The updated, non-destructive Grid plugin at
<http://rsb.info.nih.gov/ij/plugins/grid.html> requires ImageJ 1.38u or
later,
available at <http://rsb.info.nih.gov/ij/notes.html>.

-wayne

On Jul 10, 2007, at 8:58 AM, Holmes, Charlotte wrote:

> I am wanting to do something very similar to the Grid_ plugin on the
> website and was hoping seeing how it worked would help me.
>
> However I just can't get Grid_ to run. I always get the error:
>
> Note: sun.tools.javac.Main has been deprecated.
> C:\Program Files\ImageJ\plugins\Grid_.java:33: Interface
DialogListener
> of class Grid_ not found.
> public class Grid_ implements PlugIn, DialogListener {
>                                       ^
> 1 error, 1 warning
>
> I'm sorry to ask a very basic question but I've tried a lot of things
> and just don't know how to fix it. I have the latest version of ImageJ
> as well....
>