printing out pixel values to a results table

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

printing out pixel values to a results table

Paxton Provitera
Hi.

I am having the hardest time doing something that should be easy.

I want to print non-zero pixel values out to the results table.

I have 640 by 480 images that will have about 20K non-zero pixel values.
is there an easy way to do this?

thanks a ton!

-Paxton
Reply | Threaded
Open this post in threaded view
|

Re: printing out pixel values to a results table

Michael Doube-2
Hi Paxton

You might find the Log window more accommodating, i.e. the output from:

print(pixel_value, "\n");

Mike

Paxton Provitera wrote:

> Hi.
>
> I am having the hardest time doing something that should be easy.
>
> I want to print non-zero pixel values out to the results table.
>
> I have 640 by 480 images that will have about 20K non-zero pixel values.
> is there an easy way to do this?
>
> thanks a ton!
>
> -Paxton

--
Michael Doube  BPhil BVSc MRCVS
PhD Student
Dental Institute
Queen Mary, University of London
New Rd
London  E1 1BB
United Kingdom

Phone +44 (0)20 7377 7000 ext 2681
Reply | Threaded
Open this post in threaded view
|

Re: printing out pixel values to a results table

Wayne Rasband
In reply to this post by Paxton Provitera
Here is a macro that writes non-zero pixel values to the Log window.

   h=getHeight();
   w=getWidth();
   for (y=0; y<h; y++) {
       for (x=0; x<w; x++) {
           value = getPixel(x, y);
           if (value!=0) print(x, y, value);
      }
   }

-wayne

On Jun 1, 2007, at 4:06 PM, Paxton Provitera wrote:

> Hi.
>
> I am having the hardest time doing something that should be easy.
>
> I want to print non-zero pixel values out to the results table.
>
> I have 640 by 480 images that will have about 20K non-zero pixel  
> values.
> is there an easy way to do this?
>
> thanks a ton!
>
> -Paxton