Memo /
Id06Mosaic
This tutorial is part of the ID06 memo
Measure sample length from multiple radiographs
In Fit2d
- Go into the main menu, select Macros / Log Files
- Select Run Macro and choose the file with the macro (details below)
- Go out of the macro menu and select Image Processing (General)
- Select Geometric
- Select Rebin, with maximum value for x-rebin number, 1 for y-rebin number, 1 for start x, maximum value for end x, and 1 for start y.
Macro for reconstructing the full image
The following file can be saved in a macro, save it as id06Mosaic.mac, for instance.
Parameters to change absolutely:
- Name and location of the first image:
V:\photo\RWD_017\RWD_017_0630.edf - Name and location of the last image:
V:\photo\RWD_017\RWD_017_0643.edf - Name of file to save composite image:
V:\photo\RWD_017\RWD_017_0630_0643.tif - Vertical translation between images, in pixels:
328, for instance
How to calculate the translation between images
- If you take 14 images over 4 mm, there is a 4000/13=307.5 microns translation between each image
- You should divide by the pixel size, 1.0399 microns per pixel,
- If you have 10 images over 4 mm: translation is 4000/(9*1.0399) = 427.4 pixels
Parameters you can change, if you want
- Bottom pixel for cropping,
- Left pixel for cropping,
- Right pixel for cropping.
%!*\ Moving into image processing
EXIT
%!*\
%!*\ CAMERA XFOUR = 0.9375 micron pixels
%!*\ Nope, it is 1.0399 micron/pixel
%!*\ Go into keyboard interface to create variables
%!*\ You should change those parameters
%!*\ take_photo 2 -2 13 0.1
%!*\ works with version 17.002
KEYBOARD INTERFACE
VARIABLE
#FIRST
STRING VALUE
%!*\ CHANGE THIS: Path and name of first image
Y:\photo\MGO_01\MGO_01_0532.edf
VARIABLE
#LAST
STRING VALUE
%!*\ CHANGE THIS: Path and name of last image
Y:\photo\MGO_01\MGO_01_0545.edf
VARIABLE
#SAVE
STRING VALUE
%!*\ CHANGE THIS: Path and name where to save composite image
Y:\photo\MGO_01\MGO_01_0532_0545.tif
VARIABLE
#TOPPIX
FLOATING POINT (REAL) VALUE
%!*\ CHANGE THIS: Bottom pixel for cropping, was 214, was 314, was 258 was 635
650.
VARIABLE
#LEFTPIX
FLOATING POINT (REAL) VALUE
%!*\ CHANGE THIS: Left pixel for cropping, was 414
400.
VARIABLE
#RIGHTPIX
FLOATING POINT (REAL) VALUE
%!*\ CHANGE THIS: Right pixel for cropping, was 1160
1100.
VARIABLE
#TRANSLATION
FLOATING POINT (REAL) VALUE
%!*\ CHANGE THIS: Vertical translation between images, in pixels, was 473.6 9 int, was -298.205
%!*\ Number of pixels betwen each pixel: (total size in mm / nb intervals) / 1.0399
-295.9
%!*\
%!*\
%!*\ You should have nothing to touch below
%!*\
%!*\ Calculating top pixel
%!*\
CALCULATOR
#TOPPIX
#TRANSLATION
+
VARIABLE
#BOTTOMPIX
EXIT
%!*\
%!*\ Exit keyboard, enter file series and calculate composite
%!*\
%!*\
%!*\
%!*\
%!*\
EXIT
FILE SERIES
COMPOSITE
#FIRST
YES
#LAST
1
SUBTRACT
NO
ROI
YES
NO. PER ROW
1
RE-BIN NO.
1
O.K.
ZOOM IN
2
#LEFTPIX
#BOTTOMPIX
#RIGHTPIX
#TOPPIX
EXIT
EXIT
IMAGE PROCESSING (GENERAL)
GEOMETRIC
FLIP
NO
YES
EXIT
OUTPUT
TIFF 8 BIT
NO
#SAVE
0.0
3239
%!*\
%!*\ The composite image should be on the screen
%!*\