Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2397 fits support #2441

Merged
merged 3 commits into from
Jan 7, 2025
Merged

2397 fits support #2441

merged 3 commits into from
Jan 7, 2025

Conversation

JackEAllen
Copy link
Collaborator

@JackEAllen JackEAllen commented Jan 6, 2025

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 in mantidimaging/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 by mantidimaging/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

  • Verified unit tests pass
  • Manually tested dragging and dropping a FITS dataset into MI.
  • Manually tested loading a FITS dataset using CLI --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.

  • Verify unit tests pass
  • In debug mode, verifying no warnings about files not being closed returned:
    • Check if you can drag and drop a fit and fits 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)
    • Check that you can load fit and fits data into MI using the CLI argument --path (Spectrum Viewer is the best place to check this).
  • Check that tif and tiff 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

@JackEAllen JackEAllen self-assigned this Jan 6, 2025
@coveralls
Copy link

coveralls commented Jan 6, 2025

Coverage Status

coverage: 73.672% (+0.004%) from 73.668%
when pulling 6ae0879 on 2397-FITS_Support
into a5ee3dc on main.

Copy link
Collaborator

@ashleymeigh2 ashleymeigh2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look great! The addition of FITS file support is well implemented, and the refactor ensures proper file handling.

@ashleymeigh2 ashleymeigh2 enabled auto-merge January 6, 2025 14:31
Copy link
Collaborator

@ashleymeigh2 ashleymeigh2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look great! The addition of FITS file support is well implemented, and the refactor ensures proper file handling.

@ashleymeigh2 ashleymeigh2 added this pull request to the merge queue Jan 7, 2025
Merged via the queue into main with commit 406b43a Jan 7, 2025
8 checks passed
@ashleymeigh2 ashleymeigh2 deleted the 2397-FITS_Support branch January 7, 2025 09:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fits file support - Drag and Drop, load from CLI
3 participants