how to mark single pixel in a overlay

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

how to mark single pixel in a overlay

Jeremy Adler
I am want to use the overlay to mark a single pixel in an image that has been zoomed to show individual pixels - within a macro.

But I cannot see how to mark a single pixel in the overlay.
Overlay.drawRect   marks an area of 2x2 pixels centred on my target pixel but 1x1
Overlay.drawLine  with the two positions set the same, marks a single pixel offset

I can mark a single pixel using the ROI manager and then move it and convert it to an overlay, but this seems unduly cumbersome, is there a better way of marking single pixels in a overlay ?


Dr Jeremy Adler
Senior res engineer
BioVis
Dag Hammarskjölds väg 20
Uppsala Universitet,  752 37 Uppsala ,Sweden



+46 70 1679349

http://www.biovis.uu.se




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

Re: how to mark single pixel in a overlay

Herbie
Dear Jeremy,

let's face it: A pixel has no extension, it is a (point with an
associated) number.

What you call a pixel, is part of a zero-order interpolation of an array
of points (numbers), i.e. an area of equal gray-level or colour.

How this area is positioned with respect to the underlying number is a
matter of taste. The area may be centered to the number or the number
may be on its upper left corner.

Guess what is the case when displaying images in ImageJ...

I know, all this won't help with your problem, but perhaps it makes the
issue clearer.

Best

Herbie

::::::::::::::::::::::::::::::::::::::::::
Am 07.01.16 um 13:45 schrieb Jeremy Adler:

> I am want to use the overlay to mark a single pixel in an image that
> has been zoomed to show individual pixels - within a macro.
>
> But I cannot see how to mark a single pixel in the overlay.
> Overlay.drawRect   marks an area of 2x2 pixels centred on my target
> pixel but 1x1 Overlay.drawLine  with the two positions set the same,
> marks a single pixel offset
>
> I can mark a single pixel using the ROI manager and then move it and
> convert it to an overlay, but this seems unduly cumbersome, is there
> a better way of marking single pixels in a overlay ?
>
>
> Dr Jeremy Adler Senior res engineer BioVis Dag Hammarskjölds väg 20
> Uppsala Universitet,  752 37 Uppsala ,Sweden
>
>
>
> +46 70 1679349
>
> http://www.biovis.uu.se
>
>
>
>
> -- 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: how to mark single pixel in a overlay

Volker Baecker
In reply to this post by Jeremy Adler
Hello,
maybe you could use

makePoint(x, y);
Overlay.addSelection;
run("Select None");

to add a point selection to the overlay.

Volker


Jeremy Adler:

> I am want to use the overlay to mark a single pixel in an image that has been zoomed to show individual pixels - within a macro.
>
> But I cannot see how to mark a single pixel in the overlay.
> Overlay.drawRect   marks an area of 2x2 pixels centred on my target pixel but 1x1
> Overlay.drawLine  with the two positions set the same, marks a single pixel offset
>
> I can mark a single pixel using the ROI manager and then move it and convert it to an overlay, but this seems unduly cumbersome, is there a better way of marking single pixels in a overlay ?
>
>
> Dr Jeremy Adler
> Senior res engineer
> BioVis
> Dag Hammarskjölds väg 20
> Uppsala Universitet,  752 37 Uppsala ,Sweden
>
>
>
> +46 70 1679349
>
> http://www.biovis.uu.se
>
>
>
>
> --
> 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: how to mark single pixel in a overlay

Volker Baecker
You can do it with a rectangular selection as well:

makeRectangle(x, y, 1, 1);
Overlay.addSelection;
run("Select None");

Volker


> Hello, maybe you could use
>
> makePoint(x, y); Overlay.addSelection; run("Select None");
>
> to add a point selection to the overlay.
>
> Volker
>
>
> Jeremy Adler:
>> I am want to use the overlay to mark a single pixel in an image
>> that has been zoomed to show individual pixels - within a macro.
>>
>> But I cannot see how to mark a single pixel in the overlay.
>> Overlay.drawRect   marks an area of 2x2 pixels centred on my
>> target pixel but 1x1 Overlay.drawLine  with the two positions set
>> the same, marks a single pixel offset
>>
>> I can mark a single pixel using the ROI manager and then move it
>> and convert it to an overlay, but this seems unduly cumbersome,
>> is there a better way of marking single pixels in a overlay ?
>>
>>
>> Dr Jeremy Adler Senior res engineer BioVis Dag Hammarskjölds väg
>> 20 Uppsala Universitet,  752 37 Uppsala ,Sweden
>>
>>
>>
>> +46 70 1679349
>>
>> http://www.biovis.uu.se
>>
>>
>>
>>
>> -- 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
|

Re: how to mark single pixel in a overlay

Jeremy Adler
In reply to this post by Volker Baecker
Herbie and Volker,
Thanks for responding.

I appreciate that a pixel is a value in a array that makes up an image but in a zoomed image on a screen appears as a square of pixels with the same intensity.

makePoint()  only marks the top left of the zoomed pixel

My point is that there seems to be no simple way of marking the version of the single pixel  on the screen version of the image in a way that unambiguously identifies it - by outlining it. And it would be useful and plausible addition to the existing overlay options.

There are complex ways of marking a single pixel - briefly give it value different from all other pixels, threshold it and create a ROI - this does outline the whole zoomed pixel, oddly unlike makePoint(), and afterwards restore the original value and convert ROI to an overlay. Or I could increase the size of image by replicating pixels and draw lines around the pixel. But these solutions lack elegance.

Alternatively the pixel inspection tool mostly does what I want - to see pixel values in small area with the coordinates shown - is there a way within a macro to set the position and change this location of the centre of the Pixel Value window, or even to concurrently have more than one Pixel Value window running ?

So really this is mostly plea for an additional overlay drawing option.

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Volker Baecker
Sent: den 7 januari 2016 14:35
To: [hidden email]
Subject: Re: how to mark single pixel in a overlay

Hello,
maybe you could use

makePoint(x, y);
Overlay.addSelection;
run("Select None");

to add a point selection to the overlay.

Volker


Jeremy Adler:

> I am want to use the overlay to mark a single pixel in an image that has been zoomed to show individual pixels - within a macro.
>
> But I cannot see how to mark a single pixel in the overlay.
> Overlay.drawRect   marks an area of 2x2 pixels centred on my target pixel but 1x1
> Overlay.drawLine  with the two positions set the same, marks a single pixel offset
>
> I can mark a single pixel using the ROI manager and then move it and convert it to an overlay, but this seems unduly cumbersome, is there a better way of marking single pixels in a overlay ?
>
>
> Dr Jeremy Adler
> Senior res engineer
> BioVis
> Dag Hammarskjölds väg 20
> Uppsala Universitet,  752 37 Uppsala ,Sweden
>
>
>
> +46 70 1679349
>
> http://www.biovis.uu.se
>
>
>
>
> --
> 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
|

Re: how to mark single pixel in a overlay

Peter Haub
Hello Jeremy,

not sure what your problem exactly is. I thought Volkers answers
describe the core solutions.

Be aware that makePoint() can deal with decimal numbers.
makePoint(203.5, 85.5) works well. Also makeRectangle(203.5, 85.5, 1, 1);

If you are looking for a way to interactively select a pixel and outline
it in the overlay then use the Point Selection Tool, select a point and
run the following macro to outline this pixel.

if (selectionType() == 10){
     getSelectionBounds(x, y, w, h);
     //print(""+x+" "+y+" "+w+" "+h);
     makeRectangle(floor(x), floor(y), 1, 1);
     Overlay.addSelection;
     run("Select None");
}

Assign a shortcut to the macro for convenient handling.

Regards,
Peter

On 08.01.2016 10:43, Jeremy Adler wrote:

> Herbie and Volker,
> Thanks for responding.
>
> I appreciate that a pixel is a value in a array that makes up an image but in a zoomed image on a screen appears as a square of pixels with the same intensity.
>
> makePoint()  only marks the top left of the zoomed pixel
>
> My point is that there seems to be no simple way of marking the version of the single pixel  on the screen version of the image in a way that unambiguously identifies it - by outlining it. And it would be useful and plausible addition to the existing overlay options.
>
> There are complex ways of marking a single pixel - briefly give it value different from all other pixels, threshold it and create a ROI - this does outline the whole zoomed pixel, oddly unlike makePoint(), and afterwards restore the original value and convert ROI to an overlay. Or I could increase the size of image by replicating pixels and draw lines around the pixel. But these solutions lack elegance.
>
> Alternatively the pixel inspection tool mostly does what I want - to see pixel values in small area with the coordinates shown - is there a way within a macro to set the position and change this location of the centre of the Pixel Value window, or even to concurrently have more than one Pixel Value window running ?
>
> So really this is mostly plea for an additional overlay drawing option.
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Volker Baecker
> Sent: den 7 januari 2016 14:35
> To: [hidden email]
> Subject: Re: how to mark single pixel in a overlay
>
> Hello,
> maybe you could use
>
> makePoint(x, y);
> Overlay.addSelection;
> run("Select None");
>
> to add a point selection to the overlay.
>
> Volker
>
>
> Jeremy Adler:
>> I am want to use the overlay to mark a single pixel in an image that has been zoomed to show individual pixels - within a macro.
>>
>> But I cannot see how to mark a single pixel in the overlay.
>> Overlay.drawRect   marks an area of 2x2 pixels centred on my target pixel but 1x1
>> Overlay.drawLine  with the two positions set the same, marks a single pixel offset
>>
>> I can mark a single pixel using the ROI manager and then move it and convert it to an overlay, but this seems unduly cumbersome, is there a better way of marking single pixels in a overlay ?
>>
>>
>> Dr Jeremy Adler
>> Senior res engineer
>> BioVis
>> Dag Hammarskjölds väg 20
>> Uppsala Universitet,  752 37 Uppsala ,Sweden
>>
>>
>>
>> +46 70 1679349
>>
>> http://www.biovis.uu.se
>>
>>
>>
>>
>> --
>> 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
Reply | Threaded
Open this post in threaded view
|

Re: how to mark single pixel in a overlay

Kenneth Sloan-2
In reply to this post by Herbie
Absolutely NOT.  A pixel is an *area*, not a *point*.

Where this area is wrt an x,y coordinate is a matter of *convention*, not *taste*

The first order of business for any image processing system is to establish and enforce that convention.

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




> On Jan 7, 2016, at 08:30 , Herbie <[hidden email]> wrote:
>
> Dear Jeremy,
>
> let's face it: A pixel has no extension, it is a (point with an associated) number.
>
> What you call a pixel, is part of a zero-order interpolation of an array of points (numbers), i.e. an area of equal gray-level or colour.
>
> How this area is positioned with respect to the underlying number is a matter of taste. The area may be centered to the number or the number may be on its upper left corner.
>
> Guess what is the case when displaying images in ImageJ...
>
> I know, all this won't help with your problem, but perhaps it makes the issue clearer.
>
> Best
>
> Herbie
>
> ::::::::::::::::::::::::::::::::::::::::::
> Am 07.01.16 um 13:45 schrieb Jeremy Adler:
>> I am want to use the overlay to mark a single pixel in an image that
>> has been zoomed to show individual pixels - within a macro.
>>
>> But I cannot see how to mark a single pixel in the overlay.
>> Overlay.drawRect   marks an area of 2x2 pixels centred on my target
>> pixel but 1x1 Overlay.drawLine  with the two positions set the same,
>> marks a single pixel offset
>>
>> I can mark a single pixel using the ROI manager and then move it and
>> convert it to an overlay, but this seems unduly cumbersome, is there
>> a better way of marking single pixels in a overlay ?
>>
>>
>> Dr Jeremy Adler Senior res engineer BioVis Dag Hammarskjölds väg 20
>> Uppsala Universitet,  752 37 Uppsala ,Sweden
>>
>>
>>
>> +46 70 1679349
>>
>> http://www.biovis.uu.se
>>
>>
>>
>>
>> -- 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
|

Re: how to mark single pixel in a overlay

Robert Baer
On 1/8/2016 1:05 PM, Kenneth Sloan wrote:
> Absolutely NOT.  A pixel is an *area*, not a *point*.
>
> Where this area is wrt an x,y coordinate is a matter of *convention*, not *taste*
>
> The first order of business for any image processing system is to establish and enforce that convention.

This discussion compels me to share the link to this classic paper by
Alvy Ray Smith that I learned about from this list many years ago.  If
you have never read it, you are probably in for a treat. The title is,
/*"A Pixel is not a little square, A Pixel is not a little square, A
Pixel is not a little square, (and a voxel is not a little cube)"*/

You can find it here http://alvyray.com/Memos/CG/Microsoft/6_pixel.pdf

Enjoy,
Rob



>
> --
> Kenneth Sloan
> [hidden email]
> Vision is the art of seeing what is invisible to others.
>
>
>
>
>> On Jan 7, 2016, at 08:30 , Herbie <[hidden email]> wrote:
>>
>> Dear Jeremy,
>>
>> let's face it: A pixel has no extension, it is a (point with an associated) number.
>>
>> What you call a pixel, is part of a zero-order interpolation of an array of points (numbers), i.e. an area of equal gray-level or colour.
>>
>> How this area is positioned with respect to the underlying number is a matter of taste. The area may be centered to the number or the number may be on its upper left corner.
>>
>> Guess what is the case when displaying images in ImageJ...
>>
>> I know, all this won't help with your problem, but perhaps it makes the issue clearer.
>>
>> Best
>>
>> Herbie
>>
>> ::::::::::::::::::::::::::::::::::::::::::
>> Am 07.01.16 um 13:45 schrieb Jeremy Adler:
>>> I am want to use the overlay to mark a single pixel in an image that
>>> has been zoomed to show individual pixels - within a macro.
>>>
>>> But I cannot see how to mark a single pixel in the overlay.
>>> Overlay.drawRect   marks an area of 2x2 pixels centred on my target
>>> pixel but 1x1 Overlay.drawLine  with the two positions set the same,
>>> marks a single pixel offset
>>>
>>> I can mark a single pixel using the ROI manager and then move it and
>>> convert it to an overlay, but this seems unduly cumbersome, is there
>>> a better way of marking single pixels in a overlay ?
>>>
>>>
>>> Dr Jeremy Adler Senior res engineer BioVis Dag Hammarskjölds väg 20
>>> Uppsala Universitet,  752 37 Uppsala ,Sweden
>>>
>>>
>>>
>>> +46 70 1679349
>>>
>>> http://www.biovis.uu.se
>>>
>>>
>>>
>>>
>>> -- 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