GraytoColor & SaveImages Dissonance, Plus Naming Issue

Hi!

I’m having a couple issues with the SaveImages module that I’m pretty sure there must be an easy fix to. If I input my 2 channel image (green & red) as a gray flexfile, and then use the GraytoColor module, I can see in the module window that if I tell CP which channel is green, which is red, and to leave the blue channel black (I’ve chosen RBG), it can correctly color the images. However, when I add in 3 SaveImages modules to save the green, the red, and the overlay, this module also asks me to choose a color map. However, there’s no color map that matches the color scheme I’d like to save, which is the black>green spectrum, and the black>red spectrum that I see in the GreytoColor module window. In fact, the vast majority of the color maps lead to all black tiff files being saved.

I’m also having a problem obtaining the naming nomenclature I’d like. In each loaded flexfile, there are 4 sites imaged, and I’d like to save each colored image as either:
originalfilename_gfp_1 (or 2,3,4)
originalfilename_rfp_1 (or 2,3,4)
originalfilename_overlay_1 (or 2,3,4)

But I can’t seem to get this pattern with any combination of options. It seems like I can either get the prefix (gfp,rfp or overlay) using the “save using original file name” option, OR the field number (1,2,3,4) using the save using sequential numbers option, but not all. As a result, when I process multiple images, it always overwrites something.

Help would be much appreciated,

Thanks!

-Erin

[quote=“Erin”]I’m also having a problem obtaining the naming nomenclature I’d like. In each loaded flexfile, there are 4 sites imaged, and I’d like to save each colored image as either:
originalfilename_gfp_1 (or 2,3,4)
originalfilename_rfp_1 (or 2,3,4)
originalfilename_overlay_1 (or 2,3,4)

But I can’t seem to get this pattern with any combination of options. It seems like I can either get the prefix (gfp,rfp or overlay) using the “save using original file name” option, OR the field number (1,2,3,4) using the save using sequential numbers option, but not all. As a result, when I process multiple images, it always overwrites something.[/quote]
A workaround for doing the latter option is to use metadata extraction in LoadImages and then use the metadata in SaveImages:[ul][li]In LoadImages[list][]Select “Filename” for “Extract metadata from where?”[/li][li]Enter "(?P.).flex" (insert the appropriate extension) for the regular expression.[/li][/ul][/:m][li]In SaveImages[ul][]Select “Sequential numbers” for “Method to construct filenames”[/li][li]Under “Select file prefix”, clear whatever text is there, right-click on the edit box and select “Filename” from the drop-down box that appears, then enter “gfp” after the green metadata text.[/li][li]Do the same for each of other images you want to save.[/li][/ul][/*:m][/list:u]This will use the originalfilename prefix and append the text that you want afterwards.

Regards,
-Mark

A few clarifying notes:

  • Colormaps are only used for single channel images; for color images, the RBG colormap is already given (by definition), and cannot be changed. We probably need to clarify this in the module help.
  • Related to the above, if you want to save a single channel image in the [black,red] or [black,green] colormap, you will need to use GrayToColor to set the red (or green) channel to the image, and the other two as black. The resultant color image can then be saved.
  • Whether the saved TIFs come out as “black” depends on the original bitdepth. If you are saving an 8-bit image as a 16-bit TIF, all the pixel intensities will be placed at the lower bit end, which corresponds to the dark pixels. You may want to try to save using 8-bits.