get data type imageJ macro

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

get data type imageJ macro

PEARSON Matthew
Hi all,

I'm looking for a simple way to query the data type of an opened image within the ImageJ macro language?  I had a look through the built in functions but didn't spot something i thought would be appropriate.  Within a macro i'd like to determine what the data type of the active image is e.g. 8-bit, 16-bit, RGB then the macro will do different things depending on the result.

Thanks for the help,

Matt


--
Matt Pearson
Microscopy Facility
MRC Human Genetics Unit
Institute of Genetics and Molecular Medicine (IGMM)
University of Edinburgh
Crewe Road
EH4 2XU





--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: get data type imageJ macro

Gabriel Landini
On Thursday 15 Sep 2016 12:27:48 PEARSON Matthew wrote:
> I'm looking for a simple way to query the data type of an opened image
> within the ImageJ macro language?  I had a look through the built in
> functions but didn't spot something i thought would be appropriate.  Within
> a macro i'd like to determine what the data type of the active image is
> e.g. 8-bit, 16-bit, RGB then the macro will do different things depending


bitDepth()
Returns the bit depth of the active image: 8, 16, 24 (RGB) or 32 (float).

https://imagej.nih.gov/ij/developer/macro/functions.html

Cheers

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: get data type imageJ macro

PEARSON Matthew
Thanks Gabriel, that was very simple! Should have spotted it.

Regards,

Matt

--
Matt Pearson
Microscopy Facility
MRC Human Genetics Unit
Institute of Genetics and Molecular Medicine (IGMM)
University of Edinburgh
Crewe Road
EH4 2XU




On 15 Sep 2016, at 13:32, Gabriel Landini <[hidden email]<mailto:[hidden email]>>
 wrote:

On Thursday 15 Sep 2016 12:27:48 PEARSON Matthew wrote:
I'm looking for a simple way to query the data type of an opened image
within the ImageJ macro language?  I had a look through the built in
functions but didn't spot something i thought would be appropriate.  Within
a macro i'd like to determine what the data type of the active image is
e.g. 8-bit, 16-bit, RGB then the macro will do different things depending


bitDepth()
Returns the bit depth of the active image: 8, 16, 24 (RGB) or 32 (float).

https://imagej.nih.gov/ij/developer/macro/functions.html

Cheers

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: get data type imageJ macro

GuyM
In reply to this post by PEARSON Matthew
Hi
Try this command
bitDepth()

Returns the bit depth of the active image: 8, 16, 24 (RGB) or 32 (float). (taken from https://imagej.nih.gov/ij/developer/macro/functions.html)

Guy