News:

:) To protect your privacy, you must first log in before you can view forum statistics and user profiles

Main Menu

Surfer script to convert grid images for imagej

Started by Ben Buse, May 19, 2016, 08:55:31 PM

Previous topic - Next topic

Ben Buse

Hi,

I've attached a script (modified from scripts on surfer website) which converts all the grid files within a folder into .img files -these files can by opened in imagej (including by dragging on to imagej) - a hdr file is also created which must be kept in the same folder.



To use the script - change the file_directory to folder with grid files and file_directory2 to output directory.

For file_directory2 it must end with \" e.g "D:\example\" and NOT "D:\example"

Ben

Probeman

#1
Quote from: Ben Buse on May 19, 2016, 08:55:31 PM
I've attached a script (modified from scripts on surfer website) which converts all the grid files within a folder into .img files -these files can by opened in imagej (including by dragging on to imagej) - a hdr file is also created which must be kept in the same folder.

Hi Ben,
This is very cool.   I've used ImageJ to make stacks of images for GIF animations, like those here, but what do you use ImageJ for?

http://smf.probesoftware.com/index.php?topic=44.msg527#msg527

Also, I am no expert in Python, but does this Python script have to be run from the Python environment or can you make an executable and add some buttons that pull up an open/save file dialog for the user?  So the user doesn't have to edit the script themselves.  I think it would be even cooler...
The only stupid question is the one not asked!

Ben Buse

#2
Hi John,

Its a surfer script.

We regularly use imagej stacks of images to (1) measure concentrations of different phases; (2) plot broad line scans (averaged perpendicular to linescan) and (3) calculate errors and detection limits for different numbers of pixels summed.

It also has various image alignment plugins which are useful when there is shift between the 1st and 2nd pass off an element map - when using > 5 elements on WDS for high resolution maps, FOV 10-100 um.

Ben

Ben Buse

Hi,

I've now created a python script to convert directly from prbimg file to a comma seperated text file which imagej can open by using import text image.

I've attached the python script and it compiled as a program so that you don't need python installed


Gseward

Ben,

Thanks a lot for making this available. When all that is needed is a 32bit raw intensity image, your code is very useful for avoiding tedious usage of Calc Image and Surfer.

Cheers,

Gareth

John Donovan

Quote from: Gseward on June 29, 2017, 10:10:07 AM
Ben,

Thanks a lot for making this available. When all that is needed is a 32bit raw intensity image, your code is very useful for avoiding tedious usage of Calc Image and Surfer.

Cheers,

Gareth

By the way, Paul Carpenter says that this "stitch" plugin for ImageJ :

https://imagej.net/Image_Stitching#Grid_Collection.2FStitching_plugin

accepts not only TIF but also BMP files as input. The "mosaic" acquisition feature in Stage.exe as described here:

http://smf.probesoftware.com/index.php?topic=324.msg6078#msg6078

produces both GRD (for Surfer) and BMP files as mosaic (grid) output.  So these BMP files can now be used by the ImageJ sticth plugin now that the Stage.exe mosaic acqusition order (for both JEOL and Cameca instruments) is always left to right and top to bottom (right and down).
john
John J. Donovan, Pres. 
(541) 343-3400

"Not Absolutely Certain, Yet Reliable"