-
-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New loader: Load PNG/TIF/JPG microscopy files as Nibabel objects (#813)
* Remove apply_canonical function, revert to nib.as_closest_canonical * Remove get_voxel_size, revert to header.get_zooms * Remove get_shape, revert to header.get_data_shape * Remove get_data, revert to nibabel get_fdata * In read_file, convert png/tif/jpg to Nifti1Image object * Get pixel size from json metadata and set zooms in nifti header * loader/utils.py: Correction to filtering of extensions in bids_dataframe (was not filtering derivatives extensions before) * Update read_file in SegmentationPair to convert PNG to Nibabel object and write Nifti file * configuration_file.rst: Update extensions definition and example * Move file extension check from SegmentationPair to get_file_extension in loader/utils.py * Add update_filename_to_nifti function to loader/utils.py * test_loader.py: update test_load_dataset_2d_png * testing.py: Check extentions and update paths if not NifTI in get_gt * evaluation.py: Check extentions and update paths if not NifTI in evaluate * inference.py: Check extentions and update paths if not NifTI in pred_to_nib * Add TODO comment for inference in main.py * Add .tif and .tiff microscopy extensions to bids_dataframe * loader/utils.py: Correction to update_filename_to_nifti * Update config_new_loader.json to test the PR * Set self.extensions to nii and nii.gz by default in BidsDataframe when no extensions are provided in config * Update docs/source/configuration_file.rst Co-authored-by: Joshua Newton <joshuacwnewton@gmail.com> * Move file extension validation to read_file in SegmentationPair * Use update_filename_to_nifti to update path in read_file * Remove if self.extensions condition in filtering of bids_dataframe (always true) * Correction to PixelSize assignment and comments * Add convert_file_to_nifti method to SegmentationPair * Update update_filename_to_nifti docstings Co-authored-by: Joshua Newton <joshuacwnewton@gmail.com> * Update read_file docstrings * Add list of supported file extensions in error message in read_file * Fix resize of PixelSize Co-authored-by: Joshua Newton <joshuacwnewton@gmail.com>
- Loading branch information
1 parent
1d81b32
commit 805b394
Showing
9 changed files
with
176 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.