Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions src/imcflibs/imagej/prefs.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,28 @@
return debug == "true"


def fix_ij_options():
"""Set up ImageJ default options.

FIXME: Explain the rationale / idea!
def set_default_ij_options():
"""Configure ImageJ default options for consistency.

Set the following options:
- Ensure ImageJ appearance settings are default values.
- Set foreground color to white and background to black.
- Set black background for binary images.
- Set default file saving format to .txt files.
- Ensure images are scaled appropriately when converting between different bit depths.
"""

# disable inverting LUT
IJ.run("Appearance...", " menu=0 16-bit=Automatic")
# set foreground color to be white, background black
# Set all appearance settings to default values (untick all options)
IJ.run("Appearance...", " ")

Check warning on line 35 in src/imcflibs/imagej/prefs.py

View check run for this annotation

Codecov / codecov/patch

src/imcflibs/imagej/prefs.py#L35

Added line #L35 was not covered by tests

# Set foreground color to be white and background black
IJ.run("Colors...", "foreground=white background=black selection=red")
# black BG for binary images and pad edges when eroding
IJ.run("Options...", "black pad")
# set saving format to .txt files

# Set black background for binary images and set pad edges to false to prevent eroding from image edge
IJ.run("Options...", "black ")

Check warning on line 41 in src/imcflibs/imagej/prefs.py

View check run for this annotation

Codecov / codecov/patch

src/imcflibs/imagej/prefs.py#L41

Added line #L41 was not covered by tests

# Set default saving format to .txt files
IJ.run("Input/Output...", "file=.txt save_column save_row")
# ============= DON'T MOVE UPWARDS =============
# set "Black Background" in "Binary Options"
IJ.run("Options...", "black")
# scale when converting = checked

# Scale when converting = checked
IJ.run("Conversions...", "scale")
Loading