Hello,
I would like to label each slice of a hyperstack with its z/c/t position, basically I want the information displayed at the top of the image to be visually present in each slice. I have tried using Stack.getPosition, but it always returns NaN. Here is my macro: setFont("Arial bold",70,"antialiased"); for(z=1; z<=nSlices; z++){ setSlice(z); position = Stack.getPosition(cc, zz, tt); drawString(position, 100, 400); } Thanks, Mel -- Menelaos Symeonides Post-Doctoral Associate, Thali Lab Department of Microbiology and Molecular Genetics University of Vermont 318 Stafford Hall 95 Carrigan Dr Burlington, VT 05405 [hidden email] Phone: 802-656-1161 -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Try this syntax for example:
Stack.getPosition(channel, slice, frame); print(channel, slice, frame); Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY 10016 [hidden email]<mailto:[hidden email]> http://nyulmc.org/micros http://microscopynotes.com/ Voice direct only, no text or messages: 1-914-309-3270 and 1-646-501-0567 ________________________________ From: Menelaos Symeonides <[hidden email]> Sent: Sunday, June 10, 2018 2:11:50 PM To: [hidden email] Subject: How can I label each slice of a Hyperstack with its z/c/t position? Hello, I would like to label each slice of a hyperstack with its z/c/t position, basically I want the information displayed at the top of the image to be visually present in each slice. I have tried using Stack.getPosition, but it always returns NaN. Here is my macro: setFont("Arial bold",70,"antialiased"); for(z=1; z<=nSlices; z++){ setSlice(z); position = Stack.getPosition(cc, zz, tt); drawString(position, 100, 400); } Thanks, Mel -- Menelaos Symeonides Post-Doctoral Associate, Thali Lab Department of Microbiology and Molecular Genetics University of Vermont 318 Stafford Hall 95 Carrigan Dr Burlington, VT 05405 [hidden email] Phone: 802-656-1161 -- ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwICaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=Q1YW4TdNKJ0mB6J1xQMYe7Q95MYX4xIbv9fh4BuuMsk&s=InMzHhT7Kfw1KXCqJm9aHc0XuQsOiAr0BLBg9kINRLs&e= ------------------------------------------------------------ This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. ================================= -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Thank you, that helped me understand what was going on! I was trying to
get the output of Stack.getPosition defined as a variable, and then draw that on the image, not realizing that it returns three variables by itself and I can just use those. This macro now does what I needed: setFont("Arial bold",50,"antialiased"); for(z=1; z<=nSlices; z++){ setSlice(z); Stack.getPosition(channel, slice, frame); drawString("C=" + channel, 100, 600); drawString("Z =" + slice, 100, 700); drawString("T =" + frame, 100, 800); } Thanks again! Mel On 6/10/2018 2:16 PM, Cammer, Michael wrote: > Try this syntax for example: > > > Stack.getPosition(channel, slice, frame); > print(channel, slice, frame); > > > > Michael Cammer, Sr Research Scientist, DART Microscopy Laboratory > > NYU Langone Health, 540 First Avenue, SK2 Microscopy Suite, New York, NY 10016 > > [hidden email]<mailto:[hidden email]> http://nyulmc.org/micros http://microscopynotes.com/ > > Voice direct only, no text or messages: 1-914-309-3270 and 1-646-501-0567 > > > > ________________________________ > From: Menelaos Symeonides <[hidden email]> > Sent: Sunday, June 10, 2018 2:11:50 PM > To: [hidden email] > Subject: How can I label each slice of a Hyperstack with its z/c/t position? > > Hello, > > I would like to label each slice of a hyperstack with its z/c/t > position, basically I want the information displayed at the top of the > image to be visually present in each slice. > > I have tried using Stack.getPosition, but it always returns NaN. Here is > my macro: > > > setFont("Arial bold",70,"antialiased"); > > for(z=1; z<=nSlices; z++){ > setSlice(z); > position = Stack.getPosition(cc, zz, tt); > drawString(position, 100, 400); > } > > > > Thanks, > Mel > > > -- > Menelaos Symeonides > Post-Doctoral Associate, Thali Lab > Department of Microbiology and Molecular Genetics > University of Vermont > 318 Stafford Hall > 95 Carrigan Dr > Burlington, VT 05405 > [hidden email] > Phone: 802-656-1161 > > -- > ImageJ mailing list: https://urldefense.proofpoint.com/v2/url?u=http-3A__imagej.nih.gov_ij_list.html&d=DwICaQ&c=j5oPpO0eBH1iio48DtsedbOBGmuw5jHLjgvtN2r4ehE&r=oU_05LztNstAydlbm5L5GDu_vAdjXk3frDLx_CqKkuo&m=Q1YW4TdNKJ0mB6J1xQMYe7Q95MYX4xIbv9fh4BuuMsk&s=InMzHhT7Kfw1KXCqJm9aHc0XuQsOiAr0BLBg9kINRLs&e= > > ------------------------------------------------------------ > This email message, including any attachments, is for the sole use of the intended recipient(s) and may contain information that is proprietary, confidential, and exempt from disclosure under applicable law. Any unauthorized review, use, disclosure, or distribution is prohibited. If you have received this email in error please notify the sender by return email and delete the original message. Please note, the recipient should check this email and any attachments for the presence of viruses. The organization accepts no liability for any damage caused by any virus transmitted by this email. > ================================= > > -- > ImageJ mailing list: http://imagej.nih.gov/ij/list.html > -- ImageJ mailing list: http://imagej.nih.gov/ij/list.html |
Free forum by Nabble | Edit this page |