documents:120206pyip_cooking:python_imagej_cookbook
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
documents:120206pyip_cooking:python_imagej_cookbook [2018/07/19 14:43] – [Plugin: LOCI BioFormats, Replacing OME-TIFF XML] kota | documents:120206pyip_cooking:python_imagej_cookbook [2018/11/23 02:28] – [Getting path to a file interactively] kota | ||
---|---|---|---|
Line 96: | Line 96: | ||
</ | </ | ||
+ | ==== Getting the directory where the curently opened image is stored ==== | ||
+ | <code python: | ||
+ | from ij import IJ | ||
+ | |||
+ | imp = IJ.getImage() | ||
+ | print imp.getOriginalFileInfo().directory | ||
+ | </ | ||
==== Regular Expression to get meta information from file name ==== | ==== Regular Expression to get meta information from file name ==== | ||
Line 772: | Line 779: | ||
imps[0].show() # Channel 1 | imps[0].show() # Channel 1 | ||
imps[1].show() # Channel 2 | imps[1].show() # Channel 2 | ||
+ | </ | ||
+ | |||
+ | ==== Channel Merge ==== | ||
+ | |||
+ | [Image > Color > Merge Channels...] | ||
+ | |||
+ | <code python linenums: | ||
+ | from ij import ImagePlus | ||
+ | from ij.plugin import RGBStackMerge, | ||
+ | |||
+ | impc1 = ImagePlus(" | ||
+ | impc2 = ImagePlus(" | ||
+ | |||
+ | mergeimp = RGBStackMerge.mergeChannels([impc2, | ||
+ | |||
+ | # convert the composite image to the RGB image | ||
+ | RGBStackConverter.convertToRGB(mergeimp) | ||
+ | |||
+ | mergeimp.show() | ||
</ | </ | ||
==== Z projection ==== | ==== Z projection ==== |
documents/120206pyip_cooking/python_imagej_cookbook.txt · Last modified: 2022/10/16 07:12 by kota