Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MosaicSuite
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Sbalzarini Lab
Software
Bio-Imaging
MosaicSuite
Commits
3d89922c
Commit
3d89922c
authored
4 years ago
by
Krzysztof Gonciarz
Browse files
Options
Downloads
Patches
Plain Diff
Updated BG subtractor documentation (new macro added)
parent
89b2959a
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
doc/source/backgroundSubtraction.rst
+13
-1
13 additions, 1 deletion
doc/source/backgroundSubtraction.rst
doc/source/resources/macros/runBgSubtracktor.ijm
+61
-0
61 additions, 0 deletions
doc/source/resources/macros/runBgSubtracktor.ijm
with
74 additions
and
1 deletion
doc/source/backgroundSubtraction.rst
+
13
−
1
View file @
3d89922c
...
...
@@ -17,8 +17,20 @@ by S.Steinberg (1983).
Background Subtraction in action
Running Background Subtractor plugin in ImageJ macro.
-----------------------------------------------------
Very often there is a need to process multiple TIFF files. This process can be
simplify by using following macro.
.. literalinclude:: resources/macros/runBgSubtracktor.ijm
:language: java
:linenos:
Algorithm Description
=====================
---------------------
For better algorithm understanding please refer to `Histogram-based background subtractor forImageJ <http://mosaic.mpi-cbg.de/Downloads/BGS_manual.pdf>`_ document.
This diff is collapsed.
Click to expand it.
doc/source/resources/macros/runBgSubtracktor.ijm
0 → 100644
+
61
−
0
View file @
3d89922c
// This macro run Background Subtractor plugin from MosaicSuite
// ----- USER PARAMETERS
// Provide input directory with images and output directory
// for saving processed images (if same then input images will be changed!)
inputDirectory = "/home/gonciarz/1/testImages/"
outputDirectory="/home/gonciarz/1/results/"
// provide lenght of the sliding window, if set to -1 then plugin will auto-detect
bgSubtractorSlidingWindowLength=-1
// If auto-detection is ON it might happen that plugin is not able to calculate proper length
// If skipOnFailure is 'false' then popup window will show in such a case (good for interactive operations),
// if set to 'true' such a case will be only logged and detected lenght will be set to -1
//
// Example of log:
// Macro Options: [length=-1 skipOnFailure ]
// SkipOnFailure = true
// Auto-detected length for image a.tif=201
// Macro Options: [length=-1 skipOnFailure ]
// SkipOnFailure = true
// Auto-detected length for image failingImage.tif=-1
skipOnFailure=false
// ----- CODE
// Create output (results) directory, if exist nothing happens
File.makeDirectory(outputDirectory);
if (!File.exists(outputDirectory)) {
exit("Unable to create directory: " + outputDirectory);
}
// Iterate over all 'tif' images in inputDirectory
images=getFileList(inputDirectory);
for (i = 0; i < images.length; i++) {
// Skip if not 'tif' image
if (!endsWith(images[i],".tif")) continue;
// Open current image
fullFileName=inputDirectory + "/" + images[i];
print("Processing [" + fullFileName + "]");
open(fullFileName);
// ----- Run background subtractor ------
skipCmd = "";
if (skipOnFailure) skipCmd = "skipOnFailure";
run("Background Subtractor", "length=" + bgSubtractorSlidingWindowLength + " " + skipCmd);
// Save processed image in output directory and close it
save(outputDirectory + "/" + images[i]);
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