Roi.get/setDefaultStrokeWidth()?

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

Roi.get/setDefaultStrokeWidth()?

Kenneth Sloan-2
I'm trying to set (and later restore) the settings for strokeWidth and Color when drawing Rois in "freehand" mode.

My compilation fails because Roi.getDefaultStrokeWidth()  and Roi.setDefaultStrokeWidth() are "not found".

What am I missing?

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.

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

Re: Roi.get/setDefaultStrokeWidth()?

Peter Haub
Is your import correct?

import ij.gui.Roi;

On 05.02.2021 03:22, Kenneth Sloan wrote:

> I'm trying to set (and later restore) the settings for strokeWidth and Color when drawing Rois in "freehand" mode.
>
> My compilation fails because Roi.getDefaultStrokeWidth()  and Roi.setDefaultStrokeWidth() are "not found".
>
> What am I missing?
>
> --
> Kenneth Sloan
> [hidden email]
> Vision is the art of seeing what is invisible to others.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

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

Re: Roi.get/setDefaultStrokeWidth()?

Kenneth Sloan-2
In reply to this post by Kenneth Sloan-2
I seem to have ij-1.53c.jar (from 19 August 2020) installed, but my idiosyncratic development system involves copying to ij.jar to my development environment for  compilation purposes only.  The current ij.jar dates to 16 December 2019.

This causes problems for me every year or so...

Time for an update.

Thank you for the prompt and useful reply.  I'll try to remember this when it happens again...next year.  My usage of the API changes very slowly, so I don't hit this problem very often.

Perhaps some kind soul can suggest a lightweight (as in - not involving changing my entirement development environment to the flavor of the month) solution?  Here's the outline:

a) I use 'ant' to build my plugins
b) the build.xml creates a classpath that includes the copied ij.jar

This was created by students more than a decade ago - and it appears that they followed an ant cookbook.  As long as it works reasonably well, I am loathe to fiddle with it.  Every year or so I make a minor change - but I approach this with extreme caution!

I have about 50 active plugins in various stages of development and limited time for fiddling with build.xml files - I do a lot of copy/paste, changing only a few things (like the name).  I'm happiest when I can say 'ant' and a project compiles and produces a .jar file.

So...my current procedure is to copy the latest  ij.-nnnx.jar file from the FIJI jars file  to my development jars file and then rename it to ij.jar.  And everything works.

Looking at this now, I see a similar workaround for "bootclasspath", but I haven't had a need to update that, ever - despite having changed Java versions several times recently.  I'm now using an OpenJDK distribution.

I now am in the practice of starting a new collection of "really active plugins" every year, moving old plugins as they require changes.  For 2021, I have only 18 open projects.  Perhaps it's a good time to attempt a switch to Maven?

That still leaves me a bit puzzled about how to refer to the *currently installed* ij-nnnx.jar file, without manually editing all of the individual build.xml files.  Is there a decent 'ant' solution?  Does Maven help?  Is there a global mechanism to set this for *all* projects with one edit?  Is there a reasonable way to automatically update this when I update FIJI?  And...is Version 2.1.0/1.53c really the most current version (distributed via FIJI update?)

Oh well...perhaps I'll start learning Maven next week.  Today, I have a plugin to polish (after copying Fiji/jars/ij-153c.jar to ~/Projects2021/ij.jar...

If someone has an example of the simplest-possible-Maven project that I could use as a starter, I'd appreciate it.  Every time I'm tempted to start on this, I'm put off by the complexity of the examples, which often include many features that I don't need.  As a beginner, I find it too difficult to sort out the necessary from the ideal.  I need to start small and grow into it.

Ah...for the simplicity of 'make'.

And finally - is 'Maven' actually the current flavor-of-the-month?

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.





> On Feb 4, 2021, at 22:47, Wayne Rasband <[hidden email]> wrote:
>
> Hi Kenneth,
>
> These methods were added in ImageJ 1.52t. What version are you using? Here is a small test script that works for me on ImageJ 1.53h:
>
>  IJ.log("Version="+IJ.getVersion());
>  Roi.setDefaultStrokeWidth(5)
>  IJ.log("Stroke width="+Roi.getDefaultStrokeWidth());
>
> Best regards,
>
> -wayne
>
>> On Feb 4, 2021, at 9:22 PM, Kenneth Sloan <[hidden email]> wrote:
>>
>> I'm trying to set (and later restore) the settings for strokeWidth and Color when drawing Rois in "freehand" mode.
>>
>> My compilation fails because Roi.getDefaultStrokeWidth()  and Roi.setDefaultStrokeWidth() are "not found".
>>
>> What am I missing?
>>
>> --
>> Kenneth Sloan
>> [hidden email]
>> Vision is the art of seeing what is invisible to others.
>>
>> --
>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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

Re: Roi.get/setDefaultStrokeWidth()?

Kenneth Sloan-2
Hmmm...I just moved ij-1.53c.jar to my development environment.

When I ran FIJI, I was offered 1.53h!  So...I accepted.

Running FIJI again confirmed that I was now running 1.53h.

BUT...BUT...BUT...in FIJI/jars there is still ij_1.53c.jar, with a modification date of today!

Did the update do something wrong?  Or, did I?

I would have expected to find ij_1.53h.jar in FIJI/jars.  Am I confused?

===========

To those who suffered through my last rant, I have started the process of converting to Maven.

"Maven in 5 minutes" took a half hour.  I have many questions - but I will forge ahead.  Perhaps I'll be ready to make the switch for my 2022 development cycle.  It still looks like serious overkill for my needs - but I'm flexible.

===========

--
Kenneth Sloan
[hidden email]
Vision is the art of seeing what is invisible to others.





> On Feb 5, 2021, at 12:04, Kenneth Sloan <[hidden email]> wrote:
>
> I seem to have ij-1.53c.jar (from 19 August 2020) installed, but my idiosyncratic development system involves copying to ij.jar to my development environment for  compilation purposes only.  The current ij.jar dates to 16 December 2019.
>
> This causes problems for me every year or so...
>
> Time for an update.
>
> Thank you for the prompt and useful reply.  I'll try to remember this when it happens again...next year.  My usage of the API changes very slowly, so I don't hit this problem very often.
>
> Perhaps some kind soul can suggest a lightweight (as in - not involving changing my entirement development environment to the flavor of the month) solution?  Here's the outline:
>
> a) I use 'ant' to build my plugins
> b) the build.xml creates a classpath that includes the copied ij.jar
>
> This was created by students more than a decade ago - and it appears that they followed an ant cookbook.  As long as it works reasonably well, I am loathe to fiddle with it.  Every year or so I make a minor change - but I approach this with extreme caution!
>
> I have about 50 active plugins in various stages of development and limited time for fiddling with build.xml files - I do a lot of copy/paste, changing only a few things (like the name).  I'm happiest when I can say 'ant' and a project compiles and produces a .jar file.
>
> So...my current procedure is to copy the latest  ij.-nnnx.jar file from the FIJI jars file  to my development jars file and then rename it to ij.jar.  And everything works.
>
> Looking at this now, I see a similar workaround for "bootclasspath", but I haven't had a need to update that, ever - despite having changed Java versions several times recently.  I'm now using an OpenJDK distribution.
>
> I now am in the practice of starting a new collection of "really active plugins" every year, moving old plugins as they require changes.  For 2021, I have only 18 open projects.  Perhaps it's a good time to attempt a switch to Maven?
>
> That still leaves me a bit puzzled about how to refer to the *currently installed* ij-nnnx.jar file, without manually editing all of the individual build.xml files.  Is there a decent 'ant' solution?  Does Maven help?  Is there a global mechanism to set this for *all* projects with one edit?  Is there a reasonable way to automatically update this when I update FIJI?  And...is Version 2.1.0/1.53c really the most current version (distributed via FIJI update?)
>
> Oh well...perhaps I'll start learning Maven next week.  Today, I have a plugin to polish (after copying Fiji/jars/ij-153c.jar to ~/Projects2021/ij.jar...
>
> If someone has an example of the simplest-possible-Maven project that I could use as a starter, I'd appreciate it.  Every time I'm tempted to start on this, I'm put off by the complexity of the examples, which often include many features that I don't need.  As a beginner, I find it too difficult to sort out the necessary from the ideal.  I need to start small and grow into it.
>
> Ah...for the simplicity of 'make'.
>
> And finally - is 'Maven' actually the current flavor-of-the-month?
>
> --
> Kenneth Sloan
> [hidden email]
> Vision is the art of seeing what is invisible to others.
>
>
>
>
>
>> On Feb 4, 2021, at 22:47, Wayne Rasband <[hidden email]> wrote:
>>
>> Hi Kenneth,
>>
>> These methods were added in ImageJ 1.52t. What version are you using? Here is a small test script that works for me on ImageJ 1.53h:
>>
>> IJ.log("Version="+IJ.getVersion());
>> Roi.setDefaultStrokeWidth(5)
>> IJ.log("Stroke width="+Roi.getDefaultStrokeWidth());
>>
>> Best regards,
>>
>> -wayne
>>
>>> On Feb 4, 2021, at 9:22 PM, Kenneth Sloan <[hidden email]> wrote:
>>>
>>> I'm trying to set (and later restore) the settings for strokeWidth and Color when drawing Rois in "freehand" mode.
>>>
>>> My compilation fails because Roi.getDefaultStrokeWidth()  and Roi.setDefaultStrokeWidth() are "not found".
>>>
>>> What am I missing?
>>>
>>> --
>>> Kenneth Sloan
>>> [hidden email]
>>> Vision is the art of seeing what is invisible to others.
>>>
>>> --
>>> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>>
>

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