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

Make Paganin processor work with one angle #1920

Merged
merged 13 commits into from
Dec 13, 2024
Merged

Make Paganin processor work with one angle #1920

merged 13 commits into from
Dec 13, 2024

Conversation

hrobarts
Copy link
Contributor

@hrobarts hrobarts commented Aug 30, 2024

Changes

Make PaganinProcessor work if there is just one angle in the AcquisitionData

Testing you performed

Please add any demo scripts to https://github.com/TomographicImaging/CIL-Demos/tree/main/misc
Added test case in test_DataProcessor.py

Related issues/links

Checklist

  • I have performed a self-review of my code
  • I have added docstrings in line with the guidance in the developer guide
  • I have updated the relevant documentation
  • I have implemented unit tests that cover any new or modified functionality
  • CHANGELOG.md has been updated with any functionality change
  • Request review from all relevant developers
  • Change pull request label to 'Waiting for review'

Contribution Notes

Please read and adhere to the developer guide and local patterns and conventions.

  • The content of this Pull Request (the Contribution) is intentionally submitted for inclusion in CIL (the Work) under the terms and conditions of the Apache-2.0 License
  • I confirm that the contribution does not violate any intellectual property rights of third parties

@hrobarts hrobarts linked an issue Aug 30, 2024 that may be closed by this pull request
@casperdcl casperdcl force-pushed the master branch 3 times, most recently from a910556 to f8b513b Compare September 2, 2024 13:11
@hrobarts hrobarts self-assigned this Sep 12, 2024
@hrobarts hrobarts requested a review from gfardell September 12, 2024 08:12
Copy link
Member

@gfardell gfardell left a comment

Choose a reason for hiding this comment

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

I feel like this has grown in complexity. I would try to avoid using DataContainer.fill, and instead look at dealing directly with the array i.e. numpy.copyto or equivalent. That means this whole block would condense in to one command.

You already have i and j defined so you should be able to access the array and copy the relevant portions in directly. You could either calculate the start and end indices of your data block, or reshape the array keeping singleton dimensions in.

If the data isn't in a defined order (maybe that's why you're using fill?) there's a strong argument to reorder it first as writing the memory back to the block will be significantly faster if it's a contiguous block you're writing out.

hrobarts and others added 2 commits December 6, 2024 16:25
Signed-off-by: Hannah Robarts <77114597+hrobarts@users.noreply.github.com>
@hrobarts hrobarts requested a review from gfardell December 9, 2024 09:37
Copy link
Member

@gfardell gfardell left a comment

Choose a reason for hiding this comment

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

Just some small comments/discussion points. happy for you to address/discuss/over-rule and merge when you're happy.

Wrappers/Python/cil/processors/PaganinProcessor.py Outdated Show resolved Hide resolved
Wrappers/Python/cil/processors/PaganinProcessor.py Outdated Show resolved Hide resolved
Wrappers/Python/cil/processors/PaganinProcessor.py Outdated Show resolved Hide resolved
Wrappers/Python/cil/processors/PaganinProcessor.py Outdated Show resolved Hide resolved
Wrappers/Python/cil/processors/PaganinProcessor.py Outdated Show resolved Hide resolved
Copy link
Member

@lauramurgatroyd lauramurgatroyd left a comment

Choose a reason for hiding this comment

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

Looks great

Signed-off-by: Hannah Robarts <77114597+hrobarts@users.noreply.github.com>
@hrobarts hrobarts merged commit cdb2bc9 into master Dec 13, 2024
11 checks passed
@hrobarts hrobarts deleted the paganin_updates branch December 13, 2024 12:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PaganinProcessor doesn't work on data with one angle
3 participants