Changing the code language in text windows

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Changing the code language in text windows

Stein Rørvik
When you are editing macro code in ImageJ using the built-in macro editor, the menu choice "Evaluate JavaScript" (or BeanShell / Python) changes the current code language to JavaScript and changes the extension to .js. This makes sense, but the problem is that if you do this when editing a regular macro in the ImageJ macro language, there is no way of going back to the ImageJ macro language besides saving the file to a new file ending in .ijm and reopening that file. Or at least I have not found any other way to do it. This is an annoyance, as I use Ctrl-J by habit as a shortcut for something else in another text editor, so I often press it by accident when editing ImageJ macros.

A simple solution would be to let the menu choice "Evaluate Line" (which is already there) change the code language back to the macro language, and changing the extension back to .ijm. Or to simply just remove the code change / extension change behaviour, as it is strictly not needed. If you want to evaluate a line in a JavaScript, the extension of the file whould be .js already. Currently, "Evaluate Line" is ignored if the file type was auto-changed so you are stuck after accidentally selecting any of the JavaScript / BeanShell / Python choices.

Stein


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

Re: Changing the code language in text windows

Rasband, Wayne (NIH/NIMH) [E]
On Jan 27, 2017, at 3:48 PM, Stein Rørvik <[hidden email]> wrote:
>
> When you are editing macro code in ImageJ using the built-in macro editor, the menu choice "Evaluate JavaScript" (or BeanShell / Python) changes the current code language to JavaScript and changes the extension to .js. This makes sense, but the problem is that if you do this when editing a regular macro in the ImageJ macro language, there is no way of going back to the ImageJ macro language besides saving the file to a new file ending in .ijm and reopening that file. Or at least I have not found any other way to do it. This is an annoyance, as I use Ctrl-J by habit as a shortcut for something else in another text editor, so I often press it by accident when editing ImageJ macros.

The latest ImageJ daily build (1.51j23) adds a Macros>Evaluate Macro command to the macro editor. This command changes the extension to “.ijm” if it is “.js”, “.bsh” or “.py”.

-wayne
 
> A simple solution would be to let the menu choice "Evaluate Line" (which is already there) change the code language back to the macro language, and changing the extension back to .ijm. Or to simply just remove the code change / extension change behaviour, as it is strictly not needed. If you want to evaluate a line in a JavaScript, the extension of the file whould be .js already. Currently, "Evaluate Line" is ignored if the file type was auto-changed so you are stuck after accidentally selecting any of the JavaScript / BeanShell / Python choices.
>
> Stein
>
>
> --
> 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
|  
Report Content as Inappropriate

Re: Changing the code language in text windows

Arthur172B .
Wayne:

While lurking in the electronic shadows, collecting examples of your
disciples exhausting work in mastering your magical image analysis
techniques, I now see your famous name on MY screen!  For several weeks now
I have wanted to personally ask you if you (or anyone else) has published a
textbook on learning ImageJ from scratch, with little or no previous
experience.

I attended the Univ of Mich on a scholarship (1956-58) to pursue electrical
engineering, but due to weak math study skills I left in disgrace after two
years, I did attempt to read (perhaps not "study") books on Fortran, Basic,
Cobol, Pascal, and actually programmed (mid 1970s) a Heath H-8 in its
"assembly language" front panel to print a line of text on an Epson M-80
printer. Hooray! "Six munts ago I cood not spell inguneer" but I wuz one".

Later I took a Wayne State Univ class (CSC105) on the C language and an
intro to Unix. We used the Waite Group's New C Primer Plus 2nd ed, and
Gardner's Learning Unix 2nd ed.  I was doing "A-" work in daily
assignments, but on final exam day, I accidentally hit a bad key and lost
my entire file, the instructor was not able to recover it, so I accepted a
final grade of D with no further whining.

I was then pursuing a career trying to invade the Detroit Police Dept
Scientific Lab in 1971, as I had ten years experience in engineering and
research lab photography, holography, instrumentation, and even
metallography. High-res cameras and microscopes became my passion. My
career suddenly took an unexpected diversion, I was invited to join a new
Aviation Operations Section and flew their helicopters and airplanes for
25+ years, and abandoned a science-driven goal.

Now I am renovating a Zeiss GFL darkfield microscope I was offered for
$150, it was incomplete (no lamp bulb, socket or power supply) and the left
ocular prism was damaged, although the condenser alone once sold for $800.
I have reverse-engineered the stand and came up with a home made lamp
socket, added a no-name aplanat condenser for brightfield use, all on a
Sears lathe.

I accidentally learned that ImageJ was invented by some guru, someplace, to
analyze images, and I started re-reading my WSU text books, but have
nothing on ImageJ itself. Friday I found a copy of the Waite Group C Primer
Plus, and it might start me off for a while.

Is there any efficient text that goes directly to the point in image
analysis?

What is the easiest route to adding a digital camera to a trinocular head I
found to replace the damaged one? I have a Nikon D-60 but it's a bit heavy,
I might need to invent a spring-balance mechanism to make focusing easier.
Actually, I would rather use my 1961 Linhof Techika 4x5 and stay stuck in
German history. This may require a special legacy Zeiss projection ocular,
which I have never seen.

"Thank You For Your Service!" is all I can say after reading some history
on Image.

Odd coincidence, I met one of your associates in biological microscopy on
the message board, Prof Gordon, who for some reason, decided to live in a
tiny village in backwoods Manitoba exactly where my Polish-Ukrainian family
settled in 1913. He now is a friend of my cousin, who had the only combined
restaurant, liquor store and post office in the region, with a pool
hall/barber shop next door ran by the father of my father's best childhood
friend.

Next time we visit, I will bring some new waders to search for fresh
diatoms, to swap for local pierogi.

Leonard Fashoway
Formerly spelled "Faszczowy"
Fraser Michigan







On Sun, Jan 29, 2017 at 2:43 PM, Rasband, Wayne (NIH/NIMH) [E] <
[hidden email]> wrote:

> On Jan 27, 2017, at 3:48 PM, Stein Rørvik <[hidden email]> wrote:
> >
> > When you are editing macro code in ImageJ using the built-in macro
> editor, the menu choice "Evaluate JavaScript" (or BeanShell / Python)
> changes the current code language to JavaScript and changes the extension
> to .js. This makes sense, but the problem is that if you do this when
> editing a regular macro in the ImageJ macro language, there is no way of
> going back to the ImageJ macro language besides saving the file to a new
> file ending in .ijm and reopening that file. Or at least I have not found
> any other way to do it. This is an annoyance, as I use Ctrl-J by habit as a
> shortcut for something else in another text editor, so I often press it by
> accident when editing ImageJ macros.
>
> The latest ImageJ daily build (1.51j23) adds a Macros>Evaluate Macro
> command to the macro editor. This command changes the extension to “.ijm”
> if it is “.js”, “.bsh” or “.py”.
>
> -wayne
>
> > A simple solution would be to let the menu choice "Evaluate Line" (which
> is already there) change the code language back to the macro language, and
> changing the extension back to .ijm. Or to simply just remove the code
> change / extension change behaviour, as it is strictly not needed. If you
> want to evaluate a line in a JavaScript, the extension of the file whould
> be .js already. Currently, "Evaluate Line" is ignored if the file type was
> auto-changed so you are stuck after accidentally selecting any of the
> JavaScript / BeanShell / Python choices.
> >
> > Stein
> >
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>
> --
> 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
|  
Report Content as Inappropriate

Re: Changing the code language in text windows

Stein Rørvik
In reply to this post by Rasband, Wayne (NIH/NIMH) [E]
Thank you, works perfectly!

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Rasband, Wayne (NIH/NIMH) [E]
Sent: 29. januar 2017 20:43
To: [hidden email]
Subject: Re: Changing the code language in text windows

On Jan 27, 2017, at 3:48 PM, Stein Rørvik <[hidden email]> wrote:
>
> When you are editing macro code in ImageJ using the built-in macro editor, the menu choice "Evaluate JavaScript" (or BeanShell / Python) changes the current code language to JavaScript and changes the extension to .js. This makes sense, but the problem is that if you do this when editing a regular macro in the ImageJ macro language, there is no way of going back to the ImageJ macro language besides saving the file to a new file ending in .ijm and reopening that file. Or at least I have not found any other way to do it. This is an annoyance, as I use Ctrl-J by habit as a shortcut for something else in another text editor, so I often press it by accident when editing ImageJ macros.

The latest ImageJ daily build (1.51j23) adds a Macros>Evaluate Macro command to the macro editor. This command changes the extension to ".ijm" if it is ".js", ".bsh" or ".py".

-wayne
 
> A simple solution would be to let the menu choice "Evaluate Line" (which is already there) change the code language back to the macro language, and changing the extension back to .ijm. Or to simply just remove the code change / extension change behaviour, as it is strictly not needed. If you want to evaluate a line in a JavaScript, the extension of the file whould be .js already. Currently, "Evaluate Line" is ignored if the file type was auto-changed so you are stuck after accidentally selecting any of the JavaScript / BeanShell / Python choices.
>
> Stein
>
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html

--
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
|  
Report Content as Inappropriate

Re: Changing the code language in text windows

ctrueden
In reply to this post by Arthur172B .
Hi Leonard,

See this page:
http://imagej.net/User_Guides

Regards,
Curtis

--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Sun, Jan 29, 2017 at 7:35 PM, Arthur172B . <[hidden email]> wrote:

> Wayne:
>
> While lurking in the electronic shadows, collecting examples of your
> disciples exhausting work in mastering your magical image analysis
> techniques, I now see your famous name on MY screen!  For several weeks now
> I have wanted to personally ask you if you (or anyone else) has published a
> textbook on learning ImageJ from scratch, with little or no previous
> experience.
>
> I attended the Univ of Mich on a scholarship (1956-58) to pursue electrical
> engineering, but due to weak math study skills I left in disgrace after two
> years, I did attempt to read (perhaps not "study") books on Fortran, Basic,
> Cobol, Pascal, and actually programmed (mid 1970s) a Heath H-8 in its
> "assembly language" front panel to print a line of text on an Epson M-80
> printer. Hooray! "Six munts ago I cood not spell inguneer" but I wuz one".
>
> Later I took a Wayne State Univ class (CSC105) on the C language and an
> intro to Unix. We used the Waite Group's New C Primer Plus 2nd ed, and
> Gardner's Learning Unix 2nd ed.  I was doing "A-" work in daily
> assignments, but on final exam day, I accidentally hit a bad key and lost
> my entire file, the instructor was not able to recover it, so I accepted a
> final grade of D with no further whining.
>
> I was then pursuing a career trying to invade the Detroit Police Dept
> Scientific Lab in 1971, as I had ten years experience in engineering and
> research lab photography, holography, instrumentation, and even
> metallography. High-res cameras and microscopes became my passion. My
> career suddenly took an unexpected diversion, I was invited to join a new
> Aviation Operations Section and flew their helicopters and airplanes for
> 25+ years, and abandoned a science-driven goal.
>
> Now I am renovating a Zeiss GFL darkfield microscope I was offered for
> $150, it was incomplete (no lamp bulb, socket or power supply) and the left
> ocular prism was damaged, although the condenser alone once sold for $800.
> I have reverse-engineered the stand and came up with a home made lamp
> socket, added a no-name aplanat condenser for brightfield use, all on a
> Sears lathe.
>
> I accidentally learned that ImageJ was invented by some guru, someplace, to
> analyze images, and I started re-reading my WSU text books, but have
> nothing on ImageJ itself. Friday I found a copy of the Waite Group C Primer
> Plus, and it might start me off for a while.
>
> Is there any efficient text that goes directly to the point in image
> analysis?
>
> What is the easiest route to adding a digital camera to a trinocular head I
> found to replace the damaged one? I have a Nikon D-60 but it's a bit heavy,
> I might need to invent a spring-balance mechanism to make focusing easier.
> Actually, I would rather use my 1961 Linhof Techika 4x5 and stay stuck in
> German history. This may require a special legacy Zeiss projection ocular,
> which I have never seen.
>
> "Thank You For Your Service!" is all I can say after reading some history
> on Image.
>
> Odd coincidence, I met one of your associates in biological microscopy on
> the message board, Prof Gordon, who for some reason, decided to live in a
> tiny village in backwoods Manitoba exactly where my Polish-Ukrainian family
> settled in 1913. He now is a friend of my cousin, who had the only combined
> restaurant, liquor store and post office in the region, with a pool
> hall/barber shop next door ran by the father of my father's best childhood
> friend.
>
> Next time we visit, I will bring some new waders to search for fresh
> diatoms, to swap for local pierogi.
>
> Leonard Fashoway
> Formerly spelled "Faszczowy"
> Fraser Michigan
>
>
>
>
>
>
>
> On Sun, Jan 29, 2017 at 2:43 PM, Rasband, Wayne (NIH/NIMH) [E] <
> [hidden email]> wrote:
>
> > On Jan 27, 2017, at 3:48 PM, Stein Rørvik <[hidden email]>
> wrote:
> > >
> > > When you are editing macro code in ImageJ using the built-in macro
> > editor, the menu choice "Evaluate JavaScript" (or BeanShell / Python)
> > changes the current code language to JavaScript and changes the extension
> > to .js. This makes sense, but the problem is that if you do this when
> > editing a regular macro in the ImageJ macro language, there is no way of
> > going back to the ImageJ macro language besides saving the file to a new
> > file ending in .ijm and reopening that file. Or at least I have not found
> > any other way to do it. This is an annoyance, as I use Ctrl-J by habit
> as a
> > shortcut for something else in another text editor, so I often press it
> by
> > accident when editing ImageJ macros.
> >
> > The latest ImageJ daily build (1.51j23) adds a Macros>Evaluate Macro
> > command to the macro editor. This command changes the extension to “.ijm”
> > if it is “.js”, “.bsh” or “.py”.
> >
> > -wayne
> >
> > > A simple solution would be to let the menu choice "Evaluate Line"
> (which
> > is already there) change the code language back to the macro language,
> and
> > changing the extension back to .ijm. Or to simply just remove the code
> > change / extension change behaviour, as it is strictly not needed. If you
> > want to evaluate a line in a JavaScript, the extension of the file whould
> > be .js already. Currently, "Evaluate Line" is ignored if the file type
> was
> > auto-changed so you are stuck after accidentally selecting any of the
> > JavaScript / BeanShell / Python choices.
> > >
> > > Stein
> > >
> > >
> > > --
> > > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
> > --
> > ImageJ mailing list: http://imagej.nih.gov/ij/list.html
> >
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

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