Does anyone know how to approach building a "live lens cursor" tool
for ImageJ that would give a magnified view of the region of an image directly beneath the cursor as it moved? I've seen this in various (unremembered) places in the past, and would like to try to implement it for use in an ImageJ plugin. A search of the list archive didn't bring up anything on this, and I haven't found anything via a quick web search. I'm not sure whether this would be based on some sort of dynamic "layering", or whether it would entail creating an actual cursor. A fall back would be to create a dual image that shows dynamic magnified content. Thanks for any thoughts, java code, or pointers. Bill Christens-Barry --------------------------------- Bill Christens-Barry, PhD Equipoise Imaging, LLC [hidden email] --------------------------------- |
I implemented something that I call "pixel spy". It opens a second image
that is a copy of the region under the mouse pointer and that is updated as you move the mouse. You can zoom in and out as for any other image in imagej. It is not an imagej plugin. But you could make one out of it easily. It is quite clumpsy. To keep the zoom set by the user it maximizes the pixel spy window and zooms in or out again. On slow computers you might see this. It works fine enough for the application it was created for but there is certainly a better way to do this. Besides I added something to the method ImageWindow>>windowActivated to get informed when the active window changes. If you know or find out how to this without changing the imagej base code please tell me. If you want to have a look at it, I can send you the source code. Volker Baecker Bill Christens-Barry wrote: > Does anyone know how to approach building a "live lens cursor" tool > for ImageJ that would give a magnified view of the region of an image > directly beneath the cursor as it moved? I've seen this in various > (unremembered) places in the past, and would like to try to implement > it for use in an ImageJ plugin. A search of the list archive didn't > bring up anything on this, and I haven't found anything via a quick > web search. > > I'm not sure whether this would be based on some sort of dynamic > "layering", or whether it would entail creating an actual cursor. A > fall back would be to create a dual image that shows dynamic > magnified content. > > > Thanks for any thoughts, java code, or pointers. > > Bill Christens-Barry > > --------------------------------- > Bill Christens-Barry, PhD > Equipoise Imaging, LLC > [hidden email] > --------------------------------- > -- passerelle antivirus du campus CNRS de Montpellier -- |
In reply to this post by Bill Christens-Barry
Bill,
Do you mean something like the accessibility magnifier in Windows, or do you want more functionality? Try Programs>accessories>Accessibilty>magnifier for a simple magnifier. I find it quite useful for image detail. It also cites a web address for other magnification utilities (haven't tried them), cheers, Bob Bob Fleming Bone Biology Group Roslin Institute Scotland, UK tel 00 44 131 527 4244 fax 00 44 131 440 0434 URL: www.roslin.ac.uk The information contained in this e-mail (including any attachments) is confidential and is intended for the use of the addressee only. The opinions expressed within this e-mail (including any attachments) are the opinions of the sender and do not necessarily constitute those of Roslin Institute (Edinburgh) ("the Institute") unless specifically stated by a sender who is duly authorised to do so on behalf of the Institute. -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]]On Behalf Of Bill Christens-Barry Sent: 07 December 2005 18:35 To: [hidden email] Subject: Live lens cursor? Does anyone know how to approach building a "live lens cursor" tool for ImageJ that would give a magnified view of the region of an image directly beneath the cursor as it moved? I've seen this in various (unremembered) places in the past, and would like to try to implement it for use in an ImageJ plugin. A search of the list archive didn't bring up anything on this, and I haven't found anything via a quick web search. I'm not sure whether this would be based on some sort of dynamic "layering", or whether it would entail creating an actual cursor. A fall back would be to create a dual image that shows dynamic magnified content. Thanks for any thoughts, java code, or pointers. Bill Christens-Barry --------------------------------- Bill Christens-Barry, PhD Equipoise Imaging, LLC [hidden email] --------------------------------- |
On Thursday 08 December 2005 11:47, bob fleming (RI) wrote:
> Do you mean something like the accessibility magnifier in Windows, or do > you want more functionality? Linux is likely to have xmag if you have X or X.Org installed and perhaps kmag if running KDE with the accessibility package. Maybe these are close to what you are looking for? Or this macro for ImageJ: http://image.bio.methods.free.fr/magtooldoc.html Cheers, G. |
In reply to this post by bob fleming (RI)
Hi,
On Thu, 8 Dec 2005, bob fleming (RI) wrote: > Try Programs>accessories>Accessibilty>magnifier for a simple magnifier. Hmm. I cannot seem to find it. Is it in Finder? Or do I have to look in Konqueror? Puzzled, Dscho |
In reply to this post by Bill Christens-Barry
Dear Dscho,
It is in that well known Windoze 2000 program at least. You might have to go to add/remove but I can't check that out as we have clever IT guys that do that for us biologists, Tschus, Bob -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]]On Behalf Of Johannes Schindelin Sent: 08 December 2005 11:57 To: [hidden email] Subject: Re: Live lens cursor? Hi, On Thu, 8 Dec 2005, bob fleming (RI) wrote: > Try Programs>accessories>Accessibilty>magnifier for a simple magnifier. Hmm. I cannot seem to find it. Is it in Finder? Or do I have to look in Konqueror? Puzzled, Dscho |
Dear Bob,
On Thu, 8 Dec 2005, bob fleming (RI) wrote: > Dear Dscho, > > It is in that well known Windoze 2000 program at least. I am sorry. I was not quite clear about what I meant. There is a reason we here use ImageJ, and that reason is *portability*. Well, there are other reasons, but the principal reason is *portability*. Portability is important to us for a plethora of reasons, not the least of which is *cost*. Since the German government reduced scientific financing quite dramatically, we no longer can pay the MicroSoft tax. There is also the reason of *time*. We were sick of spending valuable hours per week kicking out the virii. You may have an IT department that does that for you. We haven't. And then you go and propose to use a feature in an operating system we can not afford to use, and in fact, in an operating system which was the cause we looked for, and found, ImageJ, on the mailing list for the same program? I may be a bit bitter, but I have a good reason for that. Ciao, Dscho |
In reply to this post by bob fleming (RI)
Hello,
is there a way to get rid of the mouse pointer in the magnified image? cheers, Volker bob fleming (RI) wrote: >Bill, > >Do you mean something like the accessibility magnifier in Windows, or do you want more functionality? > >Try Programs>accessories>Accessibilty>magnifier for a simple magnifier. I find it quite useful for image detail. It also cites a web address for other magnification utilities (haven't tried them), > >cheers, >Bob > >Bob Fleming >Bone Biology Group >Roslin Institute >Scotland, UK >tel 00 44 131 527 4244 >fax 00 44 131 440 0434 >URL: www.roslin.ac.uk > >The information contained in this e-mail (including any attachments) is confidential and is intended for the use of the addressee only. The opinions expressed within this e-mail (including any attachments) are the opinions of the sender and do not necessarily constitute those of Roslin Institute (Edinburgh) ("the Institute") unless specifically stated by a sender who is duly authorised to do so on behalf of the Institute. > > > > >-----Original Message----- >From: ImageJ Interest Group [mailto:[hidden email]]On Behalf Of >Bill Christens-Barry >Sent: 07 December 2005 18:35 >To: [hidden email] >Subject: Live lens cursor? > > >Does anyone know how to approach building a "live lens cursor" tool >for ImageJ that would give a magnified view of the region of an image >directly beneath the cursor as it moved? I've seen this in various >(unremembered) places in the past, and would like to try to implement >it for use in an ImageJ plugin. A search of the list archive didn't >bring up anything on this, and I haven't found anything via a quick >web search. > >I'm not sure whether this would be based on some sort of dynamic >"layering", or whether it would entail creating an actual cursor. A >fall back would be to create a dual image that shows dynamic >magnified content. > > >Thanks for any thoughts, java code, or pointers. > >Bill Christens-Barry > >--------------------------------- >Bill Christens-Barry, PhD >Equipoise Imaging, LLC >[hidden email] >--------------------------------- > > > -- passerelle antivirus du campus CNRS de Montpellier -- |
In reply to this post by Bill Christens-Barry
Create a plugin that reads the pixels of a ROI around the cursor and
shows it magnified as a floating awt.image.BufferedImage by overriding the 'paint' method in an extended ImageCanvas. I accept a bid to do it for you. Albert -- Albert Cardona Molecular Cell Developmental Biology University of California Los Angeles Tel +1 310 2067376 http://www.pensament.net/java/ http://www.mcdb.ucla.edu/Research/Hartenstein/ |
In reply to this post by Bill Christens-Barry
On Thu, 8 Dec 2005 10:06:07 -0800, Albert Cardona <[hidden email]> wrote:
>Create a plugin that reads the pixels of a ROI around the cursor and >shows it magnified as a floating awt.image.BufferedImage by overriding >the 'paint' method in an extended ImageCanvas. > >I accept a bid to do it for you. > >Albert > Albert, Yes you've caught my what I was trying to say exactly. Not an ROI selection, but rather a region around the present location of the mouse. Size, magnification parameters could be given values by the user. I wonder if the method demo'd by Wayne in his Graphic_Overlay plugin would be fast enough for repainting as the mouse is moved. Bill Christens-Barry |
In reply to this post by Bill Christens-Barry
I have done just that. The code is included below.
It is not a fast method, so you're supposed to click the mouse to have the zoom updated. Le 9 déc. 05 à 16:02, Bill Christens-Barry a écrit : > I wonder if the method demo'd by Wayne in his Graphic_Overlay > plugin would be fast > enough for repainting as the mouse is moved. Jerome Graphic_Overlay_mod.java import ij.plugin.*; import ij.*; import ij.gui.*; import ij.process.*; import java.awt.*; import java.awt.image.*; import java.awt.event.*; public class Graphic_Overlay_mod implements PlugIn { public void run(String arg) { ImagePlus imp = IJ.getImage(); CustomCanvas cc = new CustomCanvas(imp); if (imp.getStackSize()>1) new StackWindow(imp, cc); else new ImageWindow(imp, cc);} class CustomCanvas extends ImageCanvas { int xpos =100; int ypos =200; int size =40; CustomCanvas(ImagePlus imp) { super(imp); } public void paint(Graphics g) { super.paint(g); drawOverlay(g); } void drawOverlay(Graphics g) { g.setColor(Color.red); g.drawRect(xpos,ypos,size,size); ImagePlus im2 = imp; g.drawImage(imp.getImage(),xpos-50,ypos-50,xpos +50,ypos+50,xpos-25,ypos-25,xpos+25,ypos+25,this); } public void mousePressed(MouseEvent e) { super.mousePressed(e); if (e.isAltDown()) { xpos = -100; ypos = -100; return; } xpos = offScreenX(e.getX()); ypos = offScreenY(e.getY()); } } } |
In reply to this post by Bill Christens-Barry
Bill,
The Graphic_Overlay.java file is certainly a start if you don't know where. But instead of drawing lines and ovals, draw awt.Image objects with the methods provided for the purpose in awt.Graphics. The example solution provided by Jerome can be greatly improved, both in usability, speed, and in magnified region sharpness. Besides, the plugin doesn't adapt to the magnification of the image. As I said, I accept a contracted job to do it for you. Otherwise follow all hints and spend your valuable time on it. Albert -- Albert Cardona Molecular Cell Developmental Biology University of California Los Angeles Tel +1 310 2067376 http://www.pensament.net/java/ http://www.mcdb.ucla.edu/Research/Hartenstein/ |
Free forum by Nabble | Edit this page |