nedhorning / RegisterPhotos

A marco for ImageJ/FIJI that co-registers near-IR and visible photo pairs
2 stars 0 forks source link

Change the Channel #5

Open Fastie opened 12 years ago

Fastie commented 12 years ago

The RegisterPhotos script currently uses the red channel from the NIR camera as the source of NIR data in NDVI calculations. This channel seems to be brighter than the other two in the modified A495.

For testing purposes, or in case someone is using a modified camera with different spectral response, it might be good to have an option to select the channel being used as the NIR data. This option might want to be protected by warnings or hidden in an Advanced Settings area.

One reason for suggesting this option is that Jeff's transmittance spectrum of the film filter in the modified A495 indicates that some light at 600 nm is passing through. Using the blue channel instead of the red might block this leak.

For testing purposes, it might also be useful to have a choice of which channel from the UNmodified camera is used to calculate NDVI. Red is used now but blue could give good results (and maybe better results in certain situations). But this might be adding to the complexity of the code without contributing much functionality.

nedhorning commented 12 years ago

This is already sort of a hidden/advanced option. All you need to do is edit the macro in notepad or some other text editor. For example, to change the band selected from the NIR image you would edit both occurrences (in the //Calculate NDVI image section) of:

Transformed"+sourceImage+" (red) to Transformed"+sourceImage+" (green)
or Transformed"+sourceImage+" (blue)

To change the Visible band selection for the NGR image you would change the following variable at the bottom of the macro with the comment //Create an NGR image: Note: This should be NRG

green=["+targetImage+" (red)] blue=["+targetImage+" (green)]

If you want the blue band of the output image (specified by blue=) to use the blue band from the visible you would replace (green) with (blue). The color in parenthesis is the band name (position) from the original image.

If you edit the macro you could save different versions so you don't have to edit it each time. One word of caution is that you should keep the spacing in the text exactly as it is.

If more of these "advances" options pop up or if editing is too much of a pain I can put an option on the first dialog box to open an advanced dialog box where the user can select these options. An alternative is to provide information in the documentation on how to do this but I don't know how many people will actually read the instructions.

nedhorning commented 12 years ago

Sorry about the bold text. I inserted two hyphens to separate the code lines from my comments and I guess GitHub interpreted that in some odd way

Fastie commented 12 years ago

Thanks Ned, it's good to know it's that easy. I might start other issues like this one just to consider for the longer term in case the macro becomes a plugin and tweaking it becomes more involved.

Hover over your comment and an edit button appears if you want to purge the offending hyphens. Press m for a Markdown cheat sheet.