Author Topic: Automated Mosaic Imaging (using Stage.exe)  (Read 19727 times)

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2596
  • Other duties as assigned...
    • Probe Software
Automated Mosaic Imaging (using Stage.exe)
« on: September 17, 2014, 04:53:13 pm »
I have just uploaded the latest automated mosaic feature for PFE. Right now you can easily digitize and acquire an array of sub images to cover a specified area on your sample. We are working on a final step to automatically mosaic all the acquired images but there are two solutions now (using the stage coordinates), and a number of shareware products that match if the sub image overlap is sufficient.

In the meantime here is the mosaic feature which is entirely usable.

To begin, start the Stage.exe application by clicking the Stage menu in the Windows "Start" button Probe Software menu. JEOL 8230/8530 users please remember that only one application that connects to the instrument can be open at a time! Then once Stage.exe is up, click on the Mosaic button in the Digitize! window as seen here:



Then follow the steps to select the appropriate stage map, the mosaic magnification for the sub images and the extent of the total mosaic area as seen above. Next utilize the "toggle" tool to turn on or off specific sub images where you do not want to acquire a sub image as seen here:



Finally specify the percent overlap and then click the Digitize Mosaic button to record the sub image positions to the position database as seen here:



Optionally one may plot the sub image positions to confirm as seen here:



Lastly, check the Confirm All Positions In Sample and Acquire Images With Confirm checkboxes and click the Confirm Positions buttons to start the sub image acquisition. Note that auto-focus may be specified if necessary as seen here:

« Last Edit: December 20, 2016, 12:23:46 pm by John Donovan »
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2596
  • Other duties as assigned...
    • Probe Software
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #1 on: September 17, 2014, 04:57:33 pm »
As I mentioned in the previous post, we are working on a method to fully automate the mosaic operation of concatenating all the sub images together as a single large GRD file for further processing, but in the meantime there are two methods that will work with a small amount of effort.

1. Utilize the manual Mosaic feature in Probe Image as seen here:



2. Utilize the Grid Mosaic feature in Surfer as seen here:



There are also some freeware imaging packages that will mosaic based on overlapped images, but the above method will work even for images with zero overlap.
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Probeman

  • Emeritus
  • *****
  • Posts: 2050
  • Never sleeps...
    • John Donovan
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #2 on: September 17, 2014, 05:05:39 pm »
Here are some instructions from Sabrina Pearson from Golden Software on utilizing the Grid Mosaic feature in Surfer. There is also apparently a script for doing this though I haven't had time to check it out!

You can use the Grid | Mosaic command with all of the grids in a single directory. This is actually a pretty quick process to select all of the grids using the dialog. Here are the steps I would use:

1. In Surfer 12, click the Grid | Mosaic command.
2. In the Open Grid(s) dialog, navigate to the desired directory.
3. Click on the first grid file. Hold down the SHIFT key and click on the last grid file.
4. Click Open.
5. Set any options in the Grid Mosaic dialog and click OK. A new grid is created with all of the mosaicked grids.

You will most likely want to set the # of Nodes in both the X and Y direction. I would recommend setting this to a value less than 10,000, but you can set it up to 2,147,483,647 rows and columns. You will likely run out of memory before hitting that maximum number of rows and columns.

There is a GridMosaic scripter command available. This allows you to read the grids in from an array. You could populate the array using all of the grid file names in a directory. I recommend taking a look at the example in the Surfer help. Click Help | Contents in Surfer 12. Then, click the + next to Surfer Automation and + next to List of Methods and Properties. Click on the GridMosaic page. You can use this in combination with a loop.

There is a recent example of something similar to this on our blog at

http://www.goldensoftware.com/blog/scripter-example-read-all-data-files-in-directory.

The only stupid question is the one not asked!

John Donovan

  • Administrator
  • Emeritus
  • *****
  • Posts: 2596
  • Other duties as assigned...
    • Probe Software
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #3 on: September 19, 2014, 12:32:14 pm »
OK, I tweaked the interface some more as you will see, but the cool thing is that in addition to loading a stage map for mosaic imaging, one can now also load any calibrated image (currently just the two point calibration, soon both the 2 point and three point calibrations) from any source (e.g., a BSE image or thin section slide scanner),  for use as a "basemap" for selecting the mosaic area and the sub images using the new Browse button as seen here:



As you can see, it loads the image in the correct position and size, but now you might say, John: I can't easily see all the sub images for deselection...  ok, so now one can also load the the specified image full size using the Load Full Size checkbox as seen here:



Now it is easy to select or deselect specific sub images based on the actual sample as seen here:

John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"

Probeman

  • Emeritus
  • *****
  • Posts: 2050
  • Never sleeps...
    • John Donovan
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #4 on: September 19, 2014, 01:10:18 pm »
Here are the two steps (as attached images) for automatically mosaicing the GRD files acquired in Stage using the Grid | Grid Mosaic menu in Surfer...

It is nice that one can select all the files in the folder to mosaic...
The only stupid question is the one not asked!

Probeman

  • Emeritus
  • *****
  • Posts: 2050
  • Never sleeps...
    • John Donovan
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #5 on: September 22, 2014, 09:57:11 pm »
Here's a new feature...

When you load an image by default it is displayed on the stage map as seen here:



Then by loading the image with the Full Size checkbox checked, the mosaic area is automatically moved to the image center and the mosaic sub images are automatically resized for the areal extent of the loaded image as seen here:

The only stupid question is the one not asked!

Probeman

  • Emeritus
  • *****
  • Posts: 2050
  • Never sleeps...
    • John Donovan
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #6 on: September 29, 2014, 03:44:31 pm »
Ok, I ran a short test of the mosaic imaging today- we decided it would be a good thing to have mosaics of all the standard blocks in their default positions for the Stage Map window!

So here is a partial mosaic image of one of our standard blocks at 15 keV, BSE signal and 144 x sub image mag, because in the full size image one can't make out the pixel mismatch from the image calibration.

Which by the way, was not performed prior to the image acquisitions. In fact it is a large extrapolation from the 400x image calibration I usually use. Note that I am also currently working on an automatic image calibration using a stage and beam scanned images.  The nice thing is that since PFE now supports multiple calibrations for both keV and mag, one can really dial in the image alignment accuracy.

Anyway, you can see in the image attached below that the alignment is excellent even extrapolating from 400x to 144x.

Also these sub images (512 x 384) were acquired with zero percent overlap. So by adjusting that slightly one could eliminate the 1 pixel gaps without having to improve the image beam scan calibration.
« Last Edit: September 29, 2014, 03:46:07 pm by Probeman »
The only stupid question is the one not asked!

Probeman

  • Emeritus
  • *****
  • Posts: 2050
  • Never sleeps...
    • John Donovan
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #7 on: September 29, 2014, 04:20:19 pm »
OK, here is the Surfer Grid | Mosaic menu for importing the GRD files to mosaic. I simply clicked <ctrl> a to select all GRD files (97 of them) and clicked OK. The screen shows the position of each sub image in your mosiac:



The complete mosaic performed in Surfer is attached below.

Remember: you need to be logged in as a member to see attachments!



« Last Edit: November 27, 2015, 09:14:44 am by Probeman »
The only stupid question is the one not asked!

Probeman

  • Emeritus
  • *****
  • Posts: 2050
  • Never sleeps...
    • John Donovan
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #8 on: October 01, 2014, 04:31:26 pm »
Another example I did to test the calibration with zero percent overlap at 2500x for each sub image (again extrapolated from a 400x calibration set), but this time in "school colors"!



Attached below is an example in more contrasting colors.

Remember to login to see attachments!
« Last Edit: October 01, 2014, 04:55:05 pm by Probeman »
The only stupid question is the one not asked!

Probeman

  • Emeritus
  • *****
  • Posts: 2050
  • Never sleeps...
    • John Donovan
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #9 on: October 02, 2014, 06:59:04 pm »
If one zooms in on the mosaic, it can be seen that with zero percent overlap, depending on the sub image, the pixel gaps are variously 0, 1 or 2 pixels wide:



I also can detect some "negative" pixel gaps (a kind of overlap) that might be a few pixels wide also.

However this is from a two year old beam scan calibration extrapolated from 400x to 2500x.  I will post more examples after I perform a recalibration of the magnification.
« Last Edit: October 02, 2014, 08:59:13 pm by John Donovan »
The only stupid question is the one not asked!

Karsten Goemann

  • Global Moderator
  • Professor
  • *****
  • Posts: 206
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #10 on: October 05, 2014, 06:42:55 pm »
Hi John,

I just tried this on our SX100. Set up and acquisition work fine. But, maybe a stupid question, where are the images stored? I haven't used the Stage application much.

It would also be good to be able to read stage positions for the corners from the instrument rather than just having to click into the stage map window.

I also have a problem with importing scanned images into the window. The scanned image overlay on top of the holder image is too narrow. Is it possible it is using the reference positions I used to calibrate the image as the image "corners"? They were in fact not in the corners. I've attached a screenshot with an example.




Probeman

  • Emeritus
  • *****
  • Posts: 2050
  • Never sleeps...
    • John Donovan
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #11 on: October 05, 2014, 07:05:56 pm »
I just tried this on our SX100. Set up and acquisition work fine. But, maybe a stupid question, where are the images stored? I haven't used the Stage application much.

Good questions.  The images are automatically stored in the UserImages\Mosaics folder.

In fact this is shown in the Stage log window as seen here:

MosaicSaveImage: Created new folder C:\UserImages\Mosaics\Mosaic Image
MosaicSaveImage: Created new folder C:\UserImages\Mosaics\Mosaic Image\Mosaic Image_10_5_2014 7;06;58 PM
MosaicImageAutomate: image saved: C:\UserImages\Mosaics\Mosaic Image\Mosaic Image_10_5_2014 7;06;58 PM\Mosaic Image_00001
MosaicImageAutomate: image saved: C:\UserImages\Mosaics\Mosaic Image\Mosaic Image_10_5_2014 7;06;58 PM\Mosaic Image_00002
MosaicImageAutomate: image saved: C:\UserImages\Mosaics\Mosaic Image\Mosaic Image_10_5_2014 7;06;58 PM\Mosaic Image_00003


It would also be good to be able to read stage positions for the corners from the instrument rather than just having to click into the stage map window.

You are correct, but I was having trouble with the code so I left it as it is for now.  But I will implement this soon.

I also have a problem with importing scanned images into the window. The scanned image overlay on top of the holder image is too narrow. Is it possible it is using the reference positions I used to calibrate the image as the image "corners"? They were in fact not in the corners. I've attached a screenshot with an example.

Ok, good catch. This I will fix. Until then please just use images that are "corner referenced".

Also, eventually, I will implement 3 fiducial references to handle changes in Z.   8)
« Last Edit: October 05, 2014, 07:12:31 pm by Probeman »
The only stupid question is the one not asked!

Karsten Goemann

  • Global Moderator
  • Professor
  • *****
  • Posts: 206
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #12 on: October 05, 2014, 09:27:36 pm »
OK, I've found them and loaded them into Surfer to generate a mosaic .GRD which I've opened in Surfer again. How can I export it from there as an Image file? The export function is currently greyed out.

Karsten Goemann

  • Global Moderator
  • Professor
  • *****
  • Posts: 206
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #13 on: October 05, 2014, 11:19:44 pm »
I've also tried concatenate in ProbeImage. It seems I have to load the .GRD files so that it recognises the position registration. Is there a way to import them all at once? So far I've only found how to import them one by one, so I just imported the first two frames. When I then try to use the concatenate function, Probe Image crashes ("has encountered a problem and needs to close"). This is using Probe Image 1.1.0.1867.

Probeman

  • Emeritus
  • *****
  • Posts: 2050
  • Never sleeps...
    • John Donovan
Re: Automated Mosaic Imaging (using PFE Stage.exe)
« Reply #14 on: October 06, 2014, 08:35:07 am »
I've also tried concatenate in ProbeImage. It seems I have to load the .GRD files so that it recognises the position registration. Is there a way to import them all at once? So far I've only found how to import them one by one, so I just imported the first two frames. When I then try to use the concatenate function, Probe Image crashes ("has encountered a problem and needs to close"). This is using Probe Image 1.1.0.1867.

Yes, Brian is aware there is a bug when trying to concatenate GRD files in Probe Image and is working on that. He is also adding GRD files to the "drag and drop" function and also adding a menu item to "Open All Files In Folder" menu.
The only stupid question is the one not asked!