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

Add dtype promotion of result in separable filter #342

Merged
merged 12 commits into from
Jul 16, 2024
Merged

Conversation

fzimmermann89
Copy link
Member

Promotes the result depending on the data and
kernel dtype. Add tests for it

Fixes #341

Promotes the result depending on the data and
kernel dtype. Add tests for it

Fixes #341
@fzimmermann89 fzimmermann89 requested a review from koflera July 3, 2024 14:58
Copy link
Member Author

@fzimmermann89 fzimmermann89 left a comment

Choose a reason for hiding this comment

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

I think this should fix the issue...

Copy link
Contributor

github-actions bot commented Jul 3, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/mrpro/algorithms/csm
   iterative_walsh.py15193%52
src/mrpro/algorithms/dcf
   dcf_voronoi.py53492%29, 62–63, 90
src/mrpro/algorithms/optimizers
   adam.py17194%78
src/mrpro/algorithms/reconstruction
   DirectReconstruction.py613641%66–71, 88–96, 108–110, 126–133, 147–158
   Reconstruction.py8188%34
src/mrpro/data
   AcqInfo.py123298%176, 214
   CsmData.py21386%28, 72–74
   DcfData.py37295%31, 79
   IData.py61395%138, 144, 148
   IHeader.py65297%90, 117
   KHeader.py1611293%37, 139–143, 178, 228, 239, 246–247, 250, 257
   KNoise.py24962%53–66
   MoveDataMixin.py1261489%28, 122, 138, 152–154, 215, 278, 292, 371, 391–392, 409–410
   QData.py32197%56
   SpatialDimension.py44198%78
   TrajectoryDescription.py14193%37
   acq_filters.py10190%61
src/mrpro/data/_kdata
   KData.py97991%121–122, 131, 139, 193–194, 229, 234–235
   KDataRemoveOsMixin.py29293%55, 57
   KDataSelectMixin.py20290%60, 76
   KDataSplitMixin.py48394%63, 93, 102
src/mrpro/data/traj_calculators
   KTrajectoryCalculator.py25292%37, 59
   KTrajectoryIsmrmrd.py13285%55, 64
   KTrajectoryPulseq.py29197%68
src/mrpro/operators
   CartesianSamplingOp.py50982%63–64, 69–70, 75–76, 102, 105, 128
   ConstraintsOp.py60297%60, 62
   EndomorphOperator.py51296%223, 227
   FiniteDifferenceOp.py27293%62, 127
   FourierOp.py77199%145
   GridSamplingOp.py122993%73–74, 83–84, 91–92, 95, 97, 99
   LinearOperator.py80495%46, 145, 265, 270
   Operator.py52198%35
   SliceProjectionOp.py166895%53, 60, 62, 68, 205, 226, 259, 299
   ZeroPadOp.py16194%44
src/mrpro/utils
   Rotation.py4532894%58–66, 106, 283, 369, 371, 398, 453, 458, 461, 476, 493, 498, 642, 647, 650, 666, 670, 745, 747, 755–756, 996, 1078
   filters.py61297%57, 62
   slice_profiles.py45687%32, 48, 125–128, 161
   sliding_window.py34197%46
   split_idx.py10280%57, 61
   zero_pad_or_crop.py31681%40, 44, 68, 71, 74, 77
TOTAL329619994% 

Tests Skipped Failures Errors Time
751 0 💤 0 ❌ 0 🔥 1m 8s ⏱️

Copy link
Collaborator

@koflera koflera left a comment

Choose a reason for hiding this comment

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

looks good to me

src/mrpro/utils/filters.py Outdated Show resolved Hide resolved
@fzimmermann89 fzimmermann89 merged commit 9b3a272 into main Jul 16, 2024
16 checks passed
@fzimmermann89 fzimmermann89 deleted the fix_341 branch July 16, 2024 14:04
fzimmermann89 added a commit that referenced this pull request Nov 10, 2024
Fixes #341
Now filtering should work with any mix of dtypes: kernel and data are first promoted to the result type.
Thus, for example, filtering a complex128 iamge with integer kernel will result in complex128 output.
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.

FiniteDifference Operator only working for torch.complex64
2 participants