macro slice labeling

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

macro slice labeling

Tony Collins-4
Is there a macro function to label stack slices along the lines of the
"stack.setSliceLabel(label, slice)" plugin function?

Tony

Tony J. Collins, Ph.D.
McMaster Biophotonics Facility
Dept. Biochemistry and Biomedical Sciences HSC 4H21A
McMaster University, Hamilton, ON, L8N 3Z5
(905) 525 9140 x28812(off.)/x26488(lab)
[hidden email]     www.macbiophotonics.ca
Reply | Threaded
Open this post in threaded view
|

Re: macro slice labeling

Michael Schmid
Hi Tony,

from the ImageJ macro documentation at
   http://rsb.info.nih.gov/ij/developer/macro/functions.html#setMetadata

setMetadata(string)
Assigns the metadata contained in the specified string to the the  
current image or stack slice. With stacks, the first 15 characters,  
or up to the first newline, are used as the slice label. (...) See  
also: getMetadata.


Michael
________________________________________________________________

On 20 Apr 2007, at 15:42, Tony Collins wrote:

> Is there a macro function to label stack slices along the lines of the
> "stack.setSliceLabel(label, slice)" plugin function?
>
> Tony
Reply | Threaded
Open this post in threaded view
|

Re: macro slice labeling

Tony Collins-4
In reply to this post by Tony Collins-4
Thanks.
Tony

Tony J. Collins, Ph.D.
McMaster Biophotonics Facility
Dept. Biochemistry and Biomedical Sciences HSC 4H21A
McMaster University, Hamilton, ON, L8N 3Z5
(905) 525 9140 x28812(off.)/x26488(lab)
[hidden email]     www.macbiophotonics.ca


> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> Michael Schmid
> Sent: April 20, 2007 10:08 AM
> To: [hidden email]
> Subject: Re: macro slice labeling
>
> Hi Tony,
>
> from the ImageJ macro documentation at
>
http://rsb.info.nih.gov/ij/developer/macro/functions.html#setMetadata

>
> setMetadata(string)
> Assigns the metadata contained in the specified string to the the
> current image or stack slice. With stacks, the first 15 characters,
> or up to the first newline, are used as the slice label. (...) See
> also: getMetadata.
>
>
> Michael
> ________________________________________________________________
>
> On 20 Apr 2007, at 15:42, Tony Collins wrote:
>
> > Is there a macro function to label stack slices along the lines of
the
> > "stack.setSliceLabel(label, slice)" plugin function?
> >
> > Tony
Reply | Threaded
Open this post in threaded view
|

Re: macro slice labeling

Denis Touroutine
In reply to this post by Tony Collins-4
Im trying to measure the mean of fluorescence intensity of my image.
Is it possible to exclude pixels with 0 value from calculatin the mean
value?
Cheers
Denis


On 4/20/07, Tony Collins <[hidden email]> wrote:

>
> Is there a macro function to label stack slices along the lines of the
> "stack.setSliceLabel(label, slice)" plugin function?
>
> Tony
>
> Tony J. Collins, Ph.D.
> McMaster Biophotonics Facility
> Dept. Biochemistry and Biomedical Sciences HSC 4H21A
> McMaster University, Hamilton, ON, L8N 3Z5
> (905) 525 9140 x28812(off.)/x26488(lab)
> [hidden email]     www.macbiophotonics.ca
>



--
Denis Touroutine
Reply | Threaded
Open this post in threaded view
|

Re: macro slice labeling

Michael Doube-2
Hi Denis

Yes you can get the mean excluding pixels of whatever range of values
you like by something like:

getRawStatistics(count, mean, min, max, std, histogram);
//histogram is an array containing the count of pixels in each bin
//i think it gets truncated at the maximum non-zero value though so be
careful
min = 1; //leaves out '0' pixels
max = 255; //assuming 8-bit image
for (i=min; i<=max;i++){
    sum = sum + i*histogram[i]; //add up all the bin counts x the bin values
    n = n + histogram[i]; //count N measurements
}
mean = sum / n;

I have a working example of this which uses the threshold settings to
set min and max, here: http://doube.net/files/VolumeFractionOfBone.txt

Hope this helps

Mike
   

Denis Touroutine wrote:

> Im trying to measure the mean of fluorescence intensity of my image.
> Is it possible to exclude pixels with 0 value from calculatin the mean
> value?
> Cheers
> Denis
>
>
> On 4/20/07, Tony Collins <[hidden email]> wrote:
>>
>> Is there a macro function to label stack slices along the lines of the
>> "stack.setSliceLabel(label, slice)" plugin function?
>>
>> Tony
>>
>> Tony J. Collins, Ph.D.
>> McMaster Biophotonics Facility
>> Dept. Biochemistry and Biomedical Sciences HSC 4H21A
>> McMaster University, Hamilton, ON, L8N 3Z5
>> (905) 525 9140 x28812(off.)/x26488(lab)
>> [hidden email]     www.macbiophotonics.ca
>>
>
>
>

--
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