Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
IJ-macros
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zahra Alirezaeizanjani
IJ-macros
Commits
8f92b13f
Commit
8f92b13f
authored
8 years ago
by
Marius Hintsche
Browse files
Options
Downloads
Patches
Plain Diff
add resolution calibration function and export
parent
3eb77b64
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
calibrate.ijm
+31
-0
31 additions, 0 deletions
calibrate.ijm
exportAvi.ijm
+14
-0
14 additions, 0 deletions
exportAvi.ijm
with
45 additions
and
0 deletions
calibrate.ijm
0 → 100644
+
31
−
0
View file @
8f92b13f
//Batch macro to set spatial and temporal resolution of supplied tiff stacks
//Arguments are:
// frame-interval frame-unit xy-pixelsize xy-unit file1 file2 ...
// (apparently file path must be absolute)
//This macro can be called in Fiji's headless mode e.g.
// fiji --headless -macro /path-to-macro.ijm /path-to-file.tif
// or by runMacro(macro, arg)
arguments = split(getArgument());
tInterval = parseFloat(arguments[0]);
tUnit = arguments[1];
xySize = parseFloat(arguments[2]);
xyUnit = arguments[3];
fileList = Array.slice(arguments,4);
if (isNaN(tInterval)) { exit("Frame interval is not a valid number."); }
setBatchMode(true);
for (i = 0; i < fileList.length; i++) {
open(fileList[i]);
//processing steps
Stack.setFrameInterval(tInterval);
Stack.setTUnit(tUnit);
setVoxelSize(xySize, xySize, xySize, xyUnit);
save(fileList[i]);
close();
}
setBatchMode(false);
This diff is collapsed.
Click to expand it.
exportAvi.ijm
+
14
−
0
View file @
8f92b13f
//Batch macro to export avi files from supplied tiff stacks.
//Batch macro to export avi files from supplied tiff stacks.
// Also prints scale bar and time stamp onto the video.
// Arguments string should be a list of absolute file paths to process.
// Arguments string should be a list of absolute file paths to process.
//This macro can be called in Fiji's headless mode e.g.
//This macro can be called in Fiji's headless mode e.g.
...
@@ -7,6 +8,10 @@
...
@@ -7,6 +8,10 @@
outExtension = ".avi";
outExtension = ".avi";
frameRate = 20;
frameRate = 20;
barWidth = 2; //µm
barHeight = 4; //px
tUnit = "";
tInterval = 1;
fileList = split(getArgument());
fileList = split(getArgument());
...
@@ -31,7 +36,16 @@ for (i = 0; i < fileList.length; i++) {
...
@@ -31,7 +36,16 @@ for (i = 0; i < fileList.length; i++) {
//processing steps
//processing steps
//frameRate = Stack.getFrameRate();
//frameRate = Stack.getFrameRate();
Stack.getUnits(xUnit, yUnit, zUnit, tUnit, vUnit);
tInterval = Stack.getFrameInterval();
print("frame= "+tInterval+" "+tUnit);
getVoxelSize(x, y, z, u); print("vx size= "+x+"x"+y+"x"+z+" "+u);
run("8-bit");
run("8-bit");
run("Scale Bar...", "width="+barWidth+" height="+barHeight+" font=12 color=White background=None location=[Lower Right] bold label");
if (tInterval > 0) {
run("Time Stamper", "starting=0 interval="+tInterval+" x=2 y=15 font=12 decimal=0 anti-aliased or="+tUnit);
print("muh");
}
run("AVI... ", "compression=JPEG frame="+frameRate+" save="+outFile);
run("AVI... ", "compression=JPEG frame="+frameRate+" save="+outFile);
close();
close();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment