Login  Register

Re: Z-coordinate in a stack

Posted by Wayne Rasband on Feb 14, 2006; 4:40am
URL: http://imagej.273.s1.nabble.com/Memory-consumption-tp3703743p3703748.html

In ImageJ 1.35p, available at <http://rsb.info.nih.gov/ij/upgrade/>,  
you can record the slice number by checking "Slice Number" in  
Analyze>Set Measurements.

-wayne

On Feb 13, 2006, at 9:53 PM, Greg Joss wrote:

> If you check 'Display Label' in Analyze>Set Measurements...
> eg in macrozzzz:
> run("Set Measurements...", "area centroid center bounding  
> integrated display redirect=None decimal=0");
> IJ measure or analyzeParticles will record the slice in the Label  
> field appended with a preceding colon ":".
>
> Unfortunately, this is not directly accessible as there is macro  
> function equivalent to
> getResult("Label", row);
> even though there is a
> setResult("Label", row, string);
>
> Although it is a bit of a sledgehammer to crack a nut, the  
> following macro code will read the ResultsTable
> and add a Column "Slice" with the value extracted from the Label  
> field. (It is quite quick even for thousands of particle result rows).
>
> Your macros can then read X,Y and Z "Slice" columns via getResult
> ("Slice",row);.
> __________________________________________
> getSliceFromLabelCol();
>
> function getSliceFromLabelCol(){
> selectWindow("Results");
> rr=split(getInfo(),"\n");
> for(i=1;i<lengthOf(rr);i++){
> rrr=split(rr[i],"\t");
> ss=split(rrr[1],":");
> ls=lengthOf(ss);
> if(ls>1){
> slice=0+ss[ls-1];
> setResult("Slice",i-1,slice);
> }
> }
> updateResults();
> }
> _________________________________________
>
>
>> On Tuesday 07 February 2006 14:26, Jo C. Bruusgaard wrote:
>>>  hello!
>>>
>>>  I have run into a problem when I use ImageJ to extract 3D  
>>> coordinates
>>>  from a stack. The x,y coordinates are written nicely to the
>>>  "measurements"-window. However, I am not able to get info about  
>>> which
>>>  slice in the stack the measurement is taken from. Does anyone know
>>>  how to do this?
>>
>> Hi,
>>
>> Are you talking about the Analyze->Measure tool? Indeed, the mass  
>> center and
>> centroid reported by that tool seem to take only the current stack  
>> slice into
>> account (ImageJ v. 1.34s).
>>
>> This missing z-coordinate is easy to "fix", but question is if  
>> supposed to
>> work like that, and if we fix it, will code/macros depending on it  
>> working
>> the way it does now break?
>>
>> Wayne, what do you think?
>>
>> --
>> Per Christian Henden
>
>
> --
> __
> Greg Joss,
> Department of Biological Sciences, Phone: (61)(2) 9850 8212
> Macquarie University,              Email: [hidden email]
> North Ryde, (Sydney,) NSW 2109, Australia