Magellanmapper

Latest version: v1.6b4

Safety actively analyzes 689579 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 7

1.6a2

Highlights in v1.6 pre-releases

- Smoother, faster interactions with main plots, including atlas label name display, label editing, and pan and zoom navigation
- Available as binary wheel to install without requiring the source code
- Simpler entry point to launch MagellanMapper: `mm`
- Atlases can be downloaded directly through [`BrainGlobe`](https://github.com/brainglobe/bg-atlasapi) (see the new "Atlases" panel)
- Atlas regions can be searched (see "Atlases > Region")
- Detection channels can be selected independently of the loaded image to overlay prior detections or compare channels (see "Detect > Chl")
- Images can be viewed as RGB (see "ROI > Channels")
- [Jupyter Notebook tutorial](https://github.com/sanderslab/magellanmapper/blob/master/bin/sample_cmds_bash.ipynb) for running common tasks

Major changes since alpha 1

- Simpler entry point to launch MagellanMapper: `mm`
- Smoother, faster interactions with main plots, including atlas label name display, label editing, and pan and zoom navigation (317)
- Image adjustment channels are radio buttons for easier selection (212)
- Existing blob archives are backed up before saving (216)
- Multiple multiplane image files can be selected directly for import instead of relying on file auto-detection (201)

See the [full release notes draft here](https://github.com/sanderslab/magellanmapper/blob/ed771e3000bf8e22fd13f09b7dbc7b0380b7f32d/docs/release/release_v1.6.md) for more details.

1.6a1

Highlights

- Available as binary wheel to install without requiring the source code
- Atlases can be downloaded directly through [`BrainGlobe`](https://github.com/brainglobe/bg-atlasapi) (see the new "Atlases" panel)
- Atlas regions can be searched (see "Atlases > Region")
- Detection channels can be selected independently of the loaded image to overlay prior detections or compare channels (see "Detect > Chl")
- Images can be viewed as RGB (see "ROI > Channels")
- [Jupyter Notebook tutorial](https://github.com/sanderslab/magellanmapper/blob/master/bin/sample_cmds_bash.ipynb) for running common tasks

See the [full release notes draft here](https://github.com/sanderslab/magellanmapper/blob/2a470c62184078dc8add9242f8d76f267651b9ea/docs/release/release_v1.6.md) for more details.

1.5.0

Highlights

This release brings many enhancements aimed at creating a smoother user experience. Key changes include:
- We overhauled the profile panel to preview each profile and show the currently loaded settings
- Window sizes and positions are now saved between sessions
- Image brightness-related settings are saved while scrolling through image planes
- On Windows platforms, we now support all major atlas refinement tasks
- Atlas smoothing supports adaptive kernel sizes per region and improves stat output
- Newly generated atlases now collect labels metadata to make the atlases more portable
- Image import supports single-plane RAW images and provides more feedback

Changes

<details>
<summary>Show details</summary>

GUI

- Profile panel overhaul (66)
- Preview profiles before adding them
- Skip the "Load" step; profiles are automaticaly loaded when added
- View the complete settings for all loaded profiles
- Clearer and more compact labels and button arrangement
- Settings panel for resetting preferences and finding version information
- Window size and position are saved as user preferences
- The default window size is smaller to fit into 720p displays
- The default focus is no longer the main image file path to avoid accidental file loading
- Registered image selectors are now more compact
- Fixed image intensity values and auto-adjustment to persist for each channel while scrolling and switching among channels (76)
- Fixed to retain opacity settings for borders images while scrolling (79)

CLI

See the [table of CLI changes](../cli.mdchanges-in-magellanmapper-v15) for a summary of all changes in v1.5

- Multiple processing tasks can be given in the same command; eg `--proc detect coloc_match` (30)
- Image preprocessing tasks have been integrated into `--proc`, no longer requiring a separate ROI profile; eg `--proc preprocess=rotate`
- The new `--prefix_out` flag allows customizing output paths when `--prefix` is used to modify input paths (73)

Atlas refinement

- Adaptive kernel sizes can be used for smoothing operations (53)
- Metadata for labels images are saved when importing an atlas and registering the atlas to another image so that the original atlas no longer needs to be available (and `--labels` argument does not to be given) when loading the atlas or registered image (65, 67)
- Smoothing metrics are output during the `--register merge_atlas_segs` task (51, 54)
- The atlas profile settings `meas_edge_dists` and `meas_smoothing` turn off these metrics to save time during atlas generation, and the profile `fewerstats` turns off both these settings (31)
- Multiprocessing is turned off for lateral extension for better performance
- Labels difference images, which map metrics for labels onto the labels themselves for data visualization, can now take specific metric files and columns from the included R package (73)
- Labels referencs loaded from CSV files now support level, abbreviation, and parent ID columns (61)
- Fixed multiprocessing tasks with SimpleElastix 2.0
- Fixed DSC metrics between the atlas and its new labels, and more DSC metrics are saved (57)
- Fixed exporting labels reference files when a label ID is missing (61)

Atlas registration

- Image masks can be set to focus the field for image registration. Use the new `--reg_suffixes fixed_mask=<suffix-or-abs-path> moving_mask=<suffix-path>` command-line sub-arguments to load these mask files. (40)
- Register multiple atlases at a time, applying the same transformation to each of them. Specify additional atlase after the first, with output paths specified as prefixes, eg: `./run.py <sample-path> <atlas1> <atlas2> --prefix <atlas1-output-path> <atlas2-output-path>`. (69)
- When registration fails, it will attempt to match more image parameters such as spacing and direction as fallbacks (71)

Cell detection

- Previously saved blobs are no longer loaded prior to re-detection
- More flexibility when loading databases with blob truth sets
- Grid searches support output path modifiers
- Fixed blob segmentation and showing labels when none of either are present
- Fixed exporting ROIs

Volumetric image processing

I/O

- Improvements to loading registered images
- The main image is no longer loaded if a registered `atlas` image is given
- Images can be specified as absolute paths using `--reg_suffixes` to load any image, including those registered to another image (36)
- Images loaded for edge detection can be configured using `--reg_suffixes`
- Files with two extensions (eg `.nii.gz`) are supported
- Files modified by `--prefix` can now also be found in the registered image dropdowns
- More support for CSV format reference files
- Improvements to image import
- Single plane RAW images can be loaded when importing files from a directory, in addition to multiplane RAW files (32)
- Skips single plane files that give errors (eg non-image files in the input directory) (83)
- Provides import error feedback in the GUI (83)
- The known parts of the import image shape are populated even if the full shape is not known
- The Bio-Formats library has been updated to support more file formats (from Bio-Formats 5.1.8 to 6.6.0 via Python-Bioformats 1.1.0 to 4.0.5, respectively) (70)
- Fixed to disable the import directory button when metadata is insufficient
- Fixed to create parent directories when importing images (44)
- Fixed to create default resolutions even when none are specified (44)
- Improvements to exporting image stacks
- Images can be exported to multiple separate figures (68)
- Sub-plots are labeled
- Image rotation arguments are applied (50)
- Plane index is only added when exporting multiple planes
- Fixed to update metadata files when loaded through the `--meta` flag (35)
- Fixed error when unable to load a profile `.yml` file

Server pipelines

- Continuous integration has been implemented through GitHub Actions to improve quality control (55)

Python stats and plots

- Scatter plot updates
- Annotation columns can be names of index columns
- Colors can be specified

R stats and plots

Code base and docs

- Multiprocessing tasks are now more widely supported in Windows (`spawn` start mode), including the `--register import_atlas`, `make_edge_images`, `merge_atlas_segs`, `vol_stats`, and `make_density_images` tasks (60, 68)
- Type hints are now being integrated, replacing docstring types for better typing info and debugging (46)

Dependency Updates

Python Dependency Changes

- Python-Bioformats has been upgraded to 4.0.5 and uses a custom package that uses the existing Javabridge rather than Python-Javabridge to avoid a higher NumPy version requirement
- Workaround for failure to install Mayavi because of a newer VTK, now pinned to 9.0.1
- Matplotlib >= 3.2 is now required

</details>

1.4.0

<details>
<summary>Show details</summary>

Installation

- Windows, macOS, and Linux standalone packages are now provided!
- MagellanMapper can now be installed without the command-line
- The Windows installer allows launching the application from the Start Menu
- The macOS app can be dragged to the Applications to access from Launchpad
- Environment setup scripts support package updates
- As we added a [new dependency](python-dependency-changes), we made it easier to update existing environments
- Re-running `bin\setup_conda.bat` on Windows updates as `bin/setup_conda` has on Mac/Linux
- `bin/venv.sh` can now also be re-run to update Venv environments
- Python version support has been expanded to 3.6-3.8 now that we have [built](python-dependency-changes) custom dependencies for these Python versions

GUI

- Reorganized options to group by viewer
- More tooltips (hover mouse over labels)
- Option to treat the ROI offset as the center of the ROI
- Atlas Editor
- Zoom in to the ROI in the Atlas Editor
- Paintbrush only appears in Edit mode
- Annotating an image without labels will generate a new labels image file
- Option to move the editor planes when moving the ROI sliders (on by default)
- Option to turn off crosslines
- Atlas labels
- Option to turn off atlas labels
- Label selection options to include both sides and child labels
- 3D visualization
- Adjust 3D surface opacities to look inside structures
- Overlay blobs detected in full resolution images onto downsampled images
- Blobs can be selected to view an ROI around specific blobs
- 3D Atlas regions and ROIs can be added sequentially (keep the new "clear" option unchecked)
- Fixed shadow panes for multichannel images, isotropic visualization, and z-axis inversion
- Maximum intensity projections
- Support added to the Atlas Editor
- Automatically applied to both the ROI and Atlas Editor when toggled
- Color styles for blobs! Color by atlas labels, channel, or unique per blob (original style)
- Registered images selections are grouped into dropdowns for a cleaner look
- Refreshes viewers when the ROI changes in more cases
- Fixed error when looking up atlas label without a loaded reference file
- Fixed the size of the ROI outline after detecting blobs

CLI

- Unrecognized arguments are simply ignored rather than giving an error
- The new `--load` parameter replaces `--proc load` as a more flexible way to specify data to load, including `--load blobs` and `--load blobs blob_matches`
- Output of profiles settings is now pretty printed for readability

Atlas refinement

- Option to increase tapering during labels lateral extension by weighting label erosion with lateral distance, set by the `wt_lat` atlas profile setting
- Set an alternative intensity image for edge detection using the registration suffixes atlas flag (`--reg_suffixes [atlas]`)
- Added a `watershed_mask_filter` setting in the `edge_aware_reannotation` atlas profile group to set the filter type and size for the watershed mask
- `atlas_mirror` profile setting to toggle mirroring the intensity image across hemispheres during atlas curation
- Fixed to exclude labels that were not eroded from undergoing watershed-based reannotation
- Fixed saving edited images loaded through the GUI (11)

Atlas registration

- Customize the atlas images used during image registration by using the `--reg_suffixes` CLI parameter
- Measure the distance from labels to specified landmarks before and after registration through the `--register labels_dist` task
- The `carve_threshold` and `holes_area` atlas profile settings are also applied to regular (non-groupwise) registration
- The similarity metric used for registration is included in the summary CSV file
- Fixed smoothing metrics for non-existent labels

Cell detection

- Blob co-localization
- Detected blobs can now be co-localized two ways:
1. Intensity-based: intensities above threshold at each blob's location in the remaining channels are considered co-localized signal
2. Match-based: blobs from different channels are matched to find spatially overlapping blobs, similarly to automated blob verification against ground truth
- The co-localization method can be set in the GUI when detecting blobs for a given ROI, shown as overlaid channel numbers (intensity-based) or corresponding blob numbers (match-based)
- The `--proc detec_coloc` task performs intensity-based co-localization during whole image detections
- The `--proc coloc_match` task performs match-based co-localization after detections were completed
- Load blob matches with `--load blob_matches`
- Block processing settings can be set per channel rather than using the same settings for all channels; any block setting difference compared with other channels' profiles will trigger processing in separate blocks
- Accuracy metrics for each ROI are saved to CSV file
- Compare atlases translated to labels from different references and children

Volumetric image processing

- Volume comparisons: include raw pixel and volume counts
- Compare volumes registered to different atlases
- Translate atlas labels IDs in one image to the IDs used in another image
- `--atlas_labels translate_labels=<translation.csv>`, where `translation.csv` is a CSV file with `FromLabel` and `ToLabel` columns
- `--atlas_labels translate_children=1` causes children of the given labels to be translated to the ID as well
- Multiple translation files can be given (separate paths by `,`) to translate IDs in each image file
- Option to compare volumes of only ROIs within a whole image using the `crop_to_first_image` option to compare matching volumes between two images by cropping the second image to the size of the first image
- Option to specify the registered images used for volume metrics through `--reg_suffixes`
- Option to specify channel(s) to include in heatmaps
- Blobs positions are scaled to the main image

I/O

- Open image files through file browsers (eg macOS Finder, Windows Explorer) (18)
- Open files in key supported file formats (eg `.npy`, `.mhd`, `.nii.gz`) by double-clicking or using "Open with...", or drag-n-drop onto the application icon in macOS
- If MagellanMapper already has a loaded image, another application instance will be opened with the new image
- Open files on macOS through URIs: `open magmap:<path>`
- Image file metadata now uses YAML format for human-readable files; NPZ files are still supported for backward-compatibility
- Logging
- Logging using the in-built Python `logging` facility is now supported, including output to log files
- The `--verbose level=<n> log_path=<path>` flag specifies the log level from 1 (`DEBUG`, most verbose) to 5 (`CRITICAL`, least verbose) and log output path
- Unhandled exceptions are now logged (saved to a temp file if caught before logging is set up) (17)
- PDF export
- Use nearest neighbor interpolation for consistency with 2D image export to other formats
- Avoid merging layers by turning off image compositing
- Matplotlib style is set more consistently to "default"
- Intensity-based co-localizations are stored in the blobs archive
- Database
- New table for blob matche
- Support foreign keys
- Atlas labels export to CSV can output the immediate parent of each label to reconstruct label hierarchy by using `--register export_regions --labels level=None orig_colors=1`, where `level=None` gets the parent rather than labels only up to that level, and `orig_colors=1` gets only labels present in the image itself
- `--proc export_planes` now exports multi-channel images combined into single planes (eg RGB images), while the new `--proc export_planes_channels` exports each image to a separate channel
- Animations can display the plane number by using the `--plot_labels text_pos=<x,y>` to specify where to place the label
- The `--series` flag is now supported for import in the GUI
- Fixed to reset blobs when loading a new image

Python stats and plots

- Perform arithmetic operations on data frame columns using `--df sum_cols`, `subtract_cols`, `multiply_cols`, `divide_cols`
- Data frame task to replace values (`--df replace_vals`)
- Added `--plot_labels x_scale` and `y_scale` parameters to set axis scaling, such as `log` for log-scaling
- Support mixed Enum and non-Enum column names in Pandas data frames
- Generate parent directories if necessary before saving a data frame
- Option to label plot lines at right edge rather than in legend
- Figures are saved by default to PNG format, even if no extension is given
- Fixed matching label rows when weighting metrics
- Fixed unnecessary decimal numbers for integers in scatter plot annotations
- Fixed error when saving a figure to an unsupported file format

R stats and plots

- A basic command-line interface has been integrated through `run.R`, including path, profile, and measurement configuration
- Use the `tryCatchLog` package to assist with stacktraces for debugging
- Update usage of `addTextLabels` to its successor package, `basicPlotterR`
- Provide feedback when plots fail to display
- Option to load custom profiles from `.R` files
- Profile parameter to customize y-axis limits
- Wilcoxon Signed Rank test now uses a standardized effect size, using the Z-statistic computed by the `rcompanion` package
- Log-scaled volcano plots use a log-modulus transform, which fixes transforms when the minimum absolute value is 0
- Fixed to generate plots in both interactive and non-interactive environments

Code base and docs

- Python APIs
- Previously Python APIs compatible with both Python 2 and 3 have been used when possible, but much of the package requires Python 3, and testing has been on Python >= 3.6
- For a more consistent and modern codebase, we are initiating use of Python 3 APIs such as `pathlib` and specifically 3.6+ features such as f-strings
- Command-line arguments are now documented in a [table](../cli.mdcommand-line-argument-reference) for easier reference
- More links to external packages in API docs
- Instructions on building the API docs (3)
- Readme cleanup (2) and tabular format for Atlas Editor shortcuts (5)
- `Blobs` and `Image5d` are being migrated to class structures for better encapsulation and additional metadata
- Initial additions of unit testing, starting with `libmag` (7)

</details>

1.4beta.3

We continue to fix many issues related to the new installed packages as we near our first official release of them!

- Launch the app and load files through the file browser in Windows and macOS
- More error logging
- Small size reduction
- macOS package is now notarized
- Fixed saving blobs in the GUI (10)
- Fixed saving edited labels image in the GUI (11)
- Fixed error when selecting some directories for import (21)
- Fixed error when adjusting the channel in the ROI Editor for overlaid images at the top or bottom of the image stack (22)
- Fixed finding the Java runtime environment when running the Mac `.app` bundle from the command-line
- Fixed error on Windows with multiple app instances or multiprocessing
- Fixed verbose argument when given alone (ie `-v`)
- Fixed adding Windows installation to the program uninstall page

These packages include all of the additional updates planned for our forthcoming v1.4 release. Please see the [release notes](https://github.com/sanderslab/magellanmapper/blob/master/docs/release/release_v1.4.md) for details on these changes. One major change is the addition of logging to file, especially necessary now that MagellanMapper from installed packages is typically launched without a console. Logs are output to `out.log` located in:

- Windows: `C:\Users\<your-username>\AppData\Local\MagellanMapper`
- macOS: `/Users/<your-username>Library/Application Support/MagellanMapper`
- Linux: `/home/<your-username>/.local/share/MagellanMapper`

Any and all feedback is welcome!

1.4.0beta.3

<details>
<summary>Show details</summary>
- After toggling the "Labels" box, all views update as soon as the Atlas Editor is entered
- Labels reference files support alternate column names (`ID` or `Region` for the region number, `name` or `RegionName` for the name)
- Command-line arguments are documented online
- Fixed error when no `JAVA_HOME` environment variable is set
- Fixed loading YAML files without any settings
</details>

Page 2 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.