Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
Closes #2397
Description
Add support for FITS files to CLI
--path
optional argument and drag and drop functionality by including fits as a filetype to be searched inmantidimaging/core/io/utility.find_first_file_that_is_possibly_a_sample
.Upon adding FITS file support to
find_first_file_that_is_possibly_a_sample()
, a new warning appeared in DEBUG mode stating that the file loaded bymantidimaging/core/io/loader/loader._fitsread
was not correctly closed after opening._fitsread
has been refactored so that it now correctly closes the image after reading.Testing
--path
argument.Acceptance Criteria
Before testing, If you rename the folders associated with the FITS dataset you plan to use for testing to match a strict tiff dataset (i.e. sample>Tomo, open>flat_before, dark>dark_before and so on), drag and drop should identify all relevant files and add to loading dialog menu or load in as part of CLI
--path
operation.fit
andfits
dataset into mantid imaging and that it is correctly identified as a valid dataset and loaded into loading dialog and then correctly into MI (Spectrum Viewer is the best place to check this)fit
andfits
data into MI using the CLI argument--path
(Spectrum Viewer is the best place to check this).tif
andtiff
files can still be loaded via drag and drop and also via--path
CLI argument.Documentation
docs/release_notes/next/fix-2397-fix-fits_file_support