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
Enhanced Image Stack Loading and Operation Handling for Flat-fielding Tests #2176
base: main
Are you sure you want to change the base?
Conversation
if frame_type in params: | ||
filename_group = FilenameGroup.from_file(config_manager.load_sample) | ||
filename_group.find_all_files() | ||
filename_group.find_related(getattr(FILE_TYPES, frame_type.upper())) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
related_filename_group = filename_group.find_related(getattr(FILE_TYPES, frame_type.upper()))
related_filename_group.find_all_files()
image_stack = loader.load(filename_group=related_filename_group)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running tests for Flat-fielding:
No related files found for dark_after
raise ValueError("selected_flat_fielding not in:", valid_methods)
ValueError: ('selected_flat_fielding not in:', ['Only Before', 'Only After', 'Both, concatenated'])
(mantidimaging-dev) PS C:\Users\44770\PycharmProjects\mantidimaging>
if frame_type in params: | ||
filename_group = FilenameGroup.from_file(config_manager.load_sample) | ||
related_filename_group = filename_group.find_related(getattr(FILE_TYPES, frame_type.upper())) | ||
related_filename_group.find_all_files() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I get AttributeError: 'NoneType' object has no attribute 'find_all_files
, so looks like you need to check if related_filename_group
is None (which will happen if it does not find that sort of related stack)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test dataset only has Flat_Before, Flat_After, Dark_Before
Description
Conditional Loading: The load_image_stack function has been modified to conditionally load flat and dark images along with the main image stack if the test case is for "Flat-fielding".
FilenameGroup Integration: Utilizes FilenameGroup for managing file paths and ensuring that required files (e.g., log files, flat, and dark images) are correctly loaded.
Enhanced Parameter Handling: Parameters for the operations are dynamically updated to include loaded flats and darks which are essential for "Flat-fielding".
Testing
Flat-fielding with Complete Data: All required flats and darks are specified and available. The function should correctly load these images and use them in the operation.
Acceptance Criteria
Run tests using both "Flat-fielding" and other operations to ensure the function reacts appropriately.
Specifically, test with missing files for "Flat-fielding" to see that the function handles errors as expected.
Integration Check: Confirm that changes do not disrupt the existing setup and integrate cleanly with the current test suite