imagej MER basics

Ok, with two people now officially requesting help using imagej to process MER images, so it is time for this topic.

I will assume that you have downloaded and installed imagej and that you have downloaded some raw MER image data from somewhere. For example, you can get images from the official MER site or from the Exploratorium site.

To test your imagej install you can use the three images below:

sol 2917 L4:

1P387141175ESFBR51P2111L4M1

sol 2917 L5:

1P387141206ESFBR51P2111L5M1

sol 2917 L6:

1P387141237ESFBR51P2111L6M1

OK, now that you have downloaded the test filter images to a convenient directory ( folder ), start the program imagej.

Click on the menu item File / Open... and navigate to the directory where you saved the test images.

Select the L4 image. It should appear in a separate window. Repeat the File/Open... for the L5 and the L6 images.

You should now have the L4, L5 and L6 images open.

Now click on the menu item Image / Color / Merge Channels...

The color Merge window should have the L4 image file name in the Red: input box and the L5 and L6 files in the Green: and Blue: boxes. The Grey: box should be *None*.

Make sure the Create Composit: check box is checked OFF. ( ie, no checkmark in the box )

If you don't want the source images automatically closed after the color image is created click "on" the Keep Source Images box.

Finally, click the OK button and you should now see a window with this image:

1P387141175ESFBR51P2111L456

Congratulations! You have just created your first MER false color image!

Now, select the menu item File / Save.

Give the color image a suitable name ( I use the name of the L4 file with "56" added after the "L4". ) and save it somewhere.

In the future I will post the command sequences as imagej macros and you can copy and paste the commands from the comments to a macro and run the macro to process the images.

For example, here is the commands for my macro L234567x2mx-3 that produces three images from all the left pancam filters:

------------------------------------------

run("16-bit");
run("Put Behind [tab]");
run("16-bit");
run("Put Behind [tab]");
run("16-bit");
run("Put Behind [tab]");
run("16-bit");
run("Put Behind [tab]");
run("16-bit");
run("Put Behind [tab]");
run("16-bit");
NT=getTitle();
NT=substring(NT,0,lengthOf(NT)-8);
run("Images to Stack");
run("Multiply...", "stack value=255.000");
run("Scale...", "x=2 y=2 width=640 height=544 interpolate process create title=Stack-1");
run("Z Project...", "start=1 stop=3 projection=[Min Intensity]");
selectWindow("Stack-1");
run("Z Project...", "start=4 stop=4 projection=[Min Intensity]");
selectWindow("Stack-1");
run("Z Project...", "start=5 stop=6 projection=[Max Intensity]");
run("Images to Stack");
rename("RGB");
selectWindow("Stack");
close();
selectWindow("Stack-1");
close();
run("Stack to RGB");
rename("L234567x2");
selectWindow("RGB");
run("Square Root", "stack");
run("Multiply...", "stack value=255.000");
run("Stack to RGB");
rename("L234567x2sqt");
selectWindow("RGB");
close();
run("Duplicate...", "title=L234567x2sqt-1");
run("Multiply...", "value=0.667");
selectWindow("L234567x2");
run("Duplicate...", "title=L234567x2-1");
run("Multiply...", "value=0.333");
imageCalculator("Add create", "L234567x2sqt-1","L234567x2-1");
//run("Image Calculator...", "image1=L234567x2sqt-1 operation=Add image2=L234567x2-1 create");
rename(NT+"L234567x2hdr");
selectWindow("L234567x2sqt-1");
close();
selectWindow("L234567x2-1");
close();
selectWindow("L234567x2sqt");
rename(NT+"L234567x2sqt");
selectWindow("L234567x2");
rename(NT+"L234567x2");

-------------------------------------

Your homework assignment: Download L2, L5 and L7 filter images and produce a "false color" L257 image.

For extra credit, download R1 and and R2 images and create a "synthetic false color" image using R2 as the Red channel, R1 as the Blue channel and the average of R1 and R2 as the green channel. Hint: Use the menu item Process / Image Calculator to compute the average.

Bummer. Can't edit the first comment of a topic. The smiley face in the sample macro is the text "8 )".

Any imagej processing issues should be discussed on this topic.

hortonheardawho>>>

Thank you. I will print this out and work on it.

Please give me a bit of time...I'm in Montreal all day tomorrow Friday but will have the chance to read it thoroughly over the drive.

Can't wait to get into it.

yt
dx


dx your a swat lol! Seriously great stuff, Horton is sure to put you through your paces!


Awsome Professor Hort.My first Mars processed image. I converted from tif to jpeg. Love that haze man. I will attempt to post link and start working on extra credit......

http://www.onlineimagehost.com/uploads/ebc4df437d.jpg


Homework L257

http://www.onlineimagehost.com/uploads/c043a325d2.jpg


Wow Hort, this is way cool..extra credit!!

http://www.onlineimagehost.com/uploads/68c74c422d.jpg


L257 false color, smoooothed by imageJ

http://www.onlineimagehost.com/uploads/f2b3713576.jpg

Fred, there is a permission problem on your server for the images - except for reply 7.

The others give a 403 error - Forbidden. You don't have permission to access /uploads/filename on this server.

You may have to flag the photos public.


Or this

L456
http://www.keepandshare.com/userpics/d/f/r/a/nk39/2012-04/sb/11111-70704110.jpg?ts=1334337423


L257

http://www.keepandshare.com/userpics/d/f/r/a/nk39/2012-04/sb/22222-20097564.jpg?ts=1334337423

L257 because i wanted to...http://www.keepandshare.com/userpics/d/f/r/a/nk39/2012-04/sb/3333-31377757.jpg?ts=1334337424


Lets do that extra credit one more time....

http://www.keepandshare.com/userpics/d/f/r/a/nk39/2012-04/sb/68c74c422d-31731808.jpg?ts=1334338214

Fred, I deleted the reply 10 with the broken links.

Why don't you create a Flickr account for your image sharing? The basic account is free and the interface is more user friendly - especially the sharing feature.

The download is simple and you have the added benefit of being able to add a long description of the image, make comments, add searchable tags, and link to other images in a variety of ways.

Did I mention it's free?

I hear ya brother. How could you tell I was using free services? lol, You giving out grades now or going to wait untill all the students have turned in thier homework?

Step it up guys this is big....

horton>>>

Here it is merged. Trust this paste works!!!This is all new to me.

yt
dx

try this one.

http://i1086.photobucket.com/albums/j451/Agentdx/Mars%203D%202012%20dx/th_RGBL456.jpg?t=1334471060

yt
dx

horton>>>

I went with 'flickr' first without success, then tried 'photobucket' for the final L456. Image a bit small but colors match your work.

I looked at the JPL Rover RAW images site and did not see the same dates you have as 2917...it only went to 2916...what gives?

Not only that but how do you find and name the images L-this or L-that? Do you require 3 images to make this work? OK, I know about RED GREEN and BLUE but where is that indicated on a B/W JPL image? This is where it gets a bit heavy for me to understand.

Can you describe that process a bit please? Thank you.

When I downloaded the 3 images in your 1st lead post there was not an 'L' number attached to each one...so when I first tried to merge the 3 pics I got some confusing colored images so I added the L4, L5 and L6 to the end of each image as described as such in your lead post so I could find them and place them in the correct placement on the colored merge Channels page. I trust I was able to do that without mucking the merge up!

The merge was successful as imaged in my 15.
It really surprised me at first to see them as one colored image.LOLOL

Thank you. Its a relief to process 1 image so far...as to your macro command lines I have no comment at the moment.

yt
dx

dx, congratulations.

Sorry about the horrid Flickr file names. Flickr generates arbitrary file names for downloaded images. I should have linked the images to either Exploratorium files or the NASA MER site files. Both of them use names with the filter information coded into the image filename.

To share a Flickr file you have to copy the code in the "Share" pulldown button that is on the top left of the picture.

First, click on the "Share" button, then click on the "Grab the HTML/BBCode triangle, then select a convenient size ( I use Medium 500 a lot ), then select HTML for this blog and then select the code ( a single click on the code will select all of the code ) and then copy it ( ctl-c ) and then, finally, paste it ( ctl-v ) in the comment filed of this blog.

Er, the pancams have no Red, Green or Blue filters. What they have is a dog's breakfast of mostly narrow band filters named 1...8. The filters for the left and right pancams are, of course, different. Each filter is explained in this document in the section for character 25 ( Camera Filter ) of the Filename.

The filter map:

( R, G, B ) = ( L4, L5, L6 )

is the closest match to a "real" natural color - with some footnotes.

There are literally dozens of color maps that are commonly used.

Perhaps the most common is the "false color" map of:

( R, G, B ) = ( L2, L5, L7 )

Notice that the sundial color chips look quite different in "false color".

The companion right eye map is the synthetic color map:

( R, G, B ) = ( R3, avg(R1,R2), R1 ) -

with a hue shift. ( don't ask. )

or perhaps something more complicated, like my favorite:

( R, G, B ) = ( max( R3,R4,R5,R6,R7), avg( R1,R2), R1 )

( avg is the average image of two different images. )

Perhaps the most unusual is the "sunset" map:

( R, G, B ) = ( R4, avg( L7,R4), L7 )

In fact, some very strange combinations are used routinely:

( R, G, B ) = ( L2, avg(L2,L6), min(L6, L7))

is used for the miniTES calibration target.

In fact you can be creative and combine the filters any way you want to highlight certain minerals. Winston has played with Ratio color to highlight hematite signatures in the images.


Perhaps now is a good time to stop the lesson and wait for the "aha" moment from the students.

hortonheardawho>>>

I just got my 'aha' moment...LOLOLOLOLOL!!!and that was a hoot to discover...and it was, believe it or not, the meaning of the 'L' and 'R' cameras as they pertained to RGB.

I did not relate them that easily and it did not connect neuronically [new word], then I realized your favorites>>>[perhaps something more complicated, like my favorite:
( R, G, B ) = ( max( R3,R4,R5,R6,R7), avg( R1,R2), R1 )

What a challenging relief that that part is over!! I remember seeing that JPL site many many years ago -and more than likely you provided it then too- but I was not merging pics at that time it was just enough to see the great difficulty in identifying an image taken from so far away. Good thing we have 26 letters in our alphabet for a 27 number+letters pic from Mars.

If I can ask one Q at this time-I have to get this right as to what I may have garned from reading the JPL site where an example is given at the bottom.

Its mentioned that, 'taken by the left PANCAM through the 535nm (green) filter'. If I extrapolate this data then can I say this:
L5 with 535nm = Green, then L4 with 601nm = Red and L6 with 484nm = Blue? And the same for the corresponding [R] Right camera filters?

Your help is invaluable. Many thanks.

yt
dx



Im still here. Readin' and chewing gum....