Overlay flatten problem

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

Overlay flatten problem

ved sharma
Dear ImageJ users,

I'm using the following macro to describe a problem I'm seeing in my flattened overlays. Run this macro and then zoom (~800%)  into flattened RGB image to look at the shape of the circle. It does not look symmetrical (see attached image). Is there a better way to draw a circle ROI->overlay->flatten?

//---------------------
run("Blobs (25K)");
makeEllipse(100, 100, 110, 100, 1.0);
run("Add Selection...");
run("Select None");
run("Flatten");
//---------------------

-Ved

blobs-result.tif (299K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Overlay flatten problem

Rasband, Wayne (NIH/NIMH) [E]
On Nov 11, 2011, at 12:36 PM, Ved Sharma wrote:

> Dear ImageJ users,
>
> I'm using the following macro to describe a problem I'm seeing in my flattened overlays. Run this macro and then zoom (~800%)  into flattened RGB image to look at the shape of the circle. It does not look symmetrical (see attached image). Is there a better way to draw a circle ROI->overlay->flatten?

Use makeOval() to draw small circles. Here is a version of your macro that draws circles with diameters from 1 to 10:

  run("Blobs (25K)");
  x = 10;
  for (i=1; i<=10; i++) {
      makeOval(x, 100-i/2, i, i);
      run("Add Selection...");
      x += i+3;
  }
  run("Select None");
  run("Flatten");

[cid:[hidden email]]


>
> //---------------------
> run("Blobs (25K)");
> makeEllipse(100, 100, 110, 100, 1.0);
> run("Add Selection...");
> run("Select None");
> run("Flatten");
> //---------------------
>
> -Ved


small-circles.jpg (27K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Overlay flatten problem

ved sharma
In reply to this post by ved sharma
That does the job. Thanks Wayne!

On a different note, I understand why flattened overlay becomes pixelated but what I don't understand is why the overlay does not look pixelated no matter how much do I zoom in the image. And if the same mechanism can be applied for flattening the overlay to make it appear smoother.

Ved
Reply | Threaded
Open this post in threaded view
|

Re: Overlay flatten problem

Michael Schmid
Hi Ved,

overlays are vector graphics, but the images are pixel (raster)  
graphics.
Most image formats like png, jpeg are for pixel graphics, not vector  
graphics.
Also, all image processing functions (e.g. everything in the ImageJ  
Process menu) need pixels, not vector graphics.

'Flatten' converts everything you see to pixels, then you can process  
the image including the overlay. Saving as png, jpeg etc. also saves  
the flattened image.

See
   http://en.wikipedia.org/wiki/Vector_graphics
   http://en.wikipedia.org/wiki/Raster_graphics

Michael
________________________________________________________________

On 11 Nov 2011, at 22:38, Ved Sharma wrote:

> That does the job. Thanks Wayne!
>
> On a different note, I understand why flattened overlay becomes  
> pixelated but what I don't understand is why the overlay does not  
> look pixelated no matter how much do I zoom in the image. And if  
> the same mechanism can be applied for flattening the overlay to  
> make it appear smoother.
>
> Ved
Reply | Threaded
Open this post in threaded view
|

Re: Overlay flatten problem

ved sharma
In reply to this post by ved sharma
Hi Michael,

I did not know that overlays are vector graphics, I assumed that they are raster graphics. Thanks for clarifying.

Ved