Distinguish between ImageJ and Fiji

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

Distinguish between ImageJ and Fiji

verified.human
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Distinguish between ImageJ and Fiji

Joel Sheffield
Can't you save the LUT from Fiji as either a .lut or a txt file, and then
open it in ImageJ?

On Tue, Jul 17, 2012 at 12:26 PM, Tom Runia <[hidden email]> wrote:

> Hi everybody,
>
> I am working on a plug-in for which I want to use some nice lookup tables.
> The lookup table I prefer to use is only available in Fiji and not in
> ImageJ.
> Is there an easy way to find out whether the user runs ImageJ or Fiji? Then
> I can fall back to another LUT that is available in ImageJ when the plug-in
> is not running in Fiji.
>
> Thanks in advance!
>
> Best, Tom
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>



--


Joel B. Sheffield, Ph.D
Department of Biology
Temple University
Philadelphia, PA 19122
Voice: 215 204 8839
e-mail: [hidden email]
URL:  http://astro.temple.edu/~jbs

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Distinguish between ImageJ and Fiji

verified.human
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Distinguish between ImageJ and Fiji

Colin Poczatek

Hi Tom,

It's pretty easy to put/access files inside you jar.  We use NetBeans
for our plugin, and this isn't exactly what you want but it's similar.  
What we do is execute a command, save it in a txt file, put it in the
jar, and then read it at runtime.  What we added to build.xml.

<!-- Added to create svn revision number in file    -->
<target name="-pre-jar">
<exec executable="svnversion" output="buildnum.txt" >
</exec>
<copy file="buildnum.txt" todir="${build.classes.dir}"/>
</target>
<!--  end addition  -->



This is the code we have to read the file from inside the jar.  Here you
might be able to just read the file and load it as a lut, or you could
copy it to the plugin directory (which I think you can get by calling
System.getProperties().getProperty("plugins.dir") )


private String extractRevisionNumber() {
         String revision = "";
         try {
             InputStream build =
getClass().getResourceAsStream("/buildnum.txt");
             InputStreamReader buildr = new InputStreamReader(build);
             BufferedReader br = new BufferedReader(buildr);
             revision = br.readLine();
             if (revision.contains(":")) {
                 revision = revision.split(":")[1].trim();
             }
             br.close();
             buildr.close();
             build.close();
         } catch (Exception v) {
             v.printStackTrace();
         }
         return revision;
     }


Maybe that helps,
Collin


On 07/18/2012 11:36 AM, Tom Runia wrote:

> Thanks, that might be a very good idea!
>
> But can you help me a step further? I can export the specific LUT as .lut
> file using Fiji, but the file is encoded so I can't access it directly.
> I want to be able to use the LUT directly from my plug-in, so it must be
> wrapped into the JAR file. What would be a good way to achieve this?
>
> gr,
>
> Tom
>
>
> 2012/7/17 Joel B. Sheffield<[hidden email]>
>
>> Can't you save the LUT from Fiji as either a .lut or a txt file, and then
>> open it in ImageJ?
>>
>> On Tue, Jul 17, 2012 at 12:26 PM, Tom Runia<[hidden email]>  wrote:
>>
>>> Hi everybody,
>>>
>>> I am working on a plug-in for which I want to use some nice lookup
>> tables.
>>> The lookup table I prefer to use is only available in Fiji and not in
>>> ImageJ.
>>> Is there an easy way to find out whether the user runs ImageJ or Fiji?
>> Then
>>> I can fall back to another LUT that is available in ImageJ when the
>> plug-in
>>> is not running in Fiji.
>>>
>>> Thanks in advance!
>>>
>>> Best, Tom
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>>
>>
>>
>> --
>>
>>
>> Joel B. Sheffield, Ph.D
>> Department of Biology
>> Temple University
>> Philadelphia, PA 19122
>> Voice: 215 204 8839
>> e-mail: [hidden email]
>> URL:  http://astro.temple.edu/~jbs
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html



The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.


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