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 Indexer #580

Draft
wants to merge 13 commits into
base: gh/fzimmermann89/35/head
Choose a base branch
from
Draft

Conversation

fzimmermann89
Copy link
Member

@fzimmermann89 fzimmermann89 commented Dec 16, 2024

Implements broadcasted indexing on tensors.

Main idea is to parse the indexing expression once, then apply it to all tensor fields.

The indexing rules are such that indexing not violate the shape inveraints of our tensors:
no axes will be removed. new axes are only introduced at the beginning of the tensor (in the other dimensions)

[ghstack-poisoned]
fzimmermann89 added a commit that referenced this pull request Dec 16, 2024
ghstack-source-id: c4416d2dd6547b6082862d10c1e640ba4726674b
ghstack-comment-id: 2544442894
Pull Request resolved: #580
Copy link
Contributor

github-actions bot commented Dec 16, 2024

Coverage

Coverage Report
FileStmtsMissCoverMissing
src/mrpro/algorithms/csm
   inati.py24196%44
   walsh.py16194%34
src/mrpro/algorithms/dcf
   dcf_voronoi.py53492%15, 48–49, 76
src/mrpro/algorithms/optimizers
   adam.py20195%69
src/mrpro/algorithms/reconstruction
   DirectReconstruction.py281643%51–71, 85
   IterativeSENSEReconstruction.py13192%76
   Reconstruction.py502256%42, 54–56, 80–87, 104–113
   RegularizedIterativeSENSEReconstruction.py411759%96–100, 114–139
src/mrpro/data
   AcqInfo.py146597%51, 55, 59, 229, 267
   CheckDataMixin.py3293689%94, 100, 102, 119, 127, 129, 131, 164–165, 188, 197, 214, 242, 258, 306, 311, 317–322, 352, 359, 445, 447, 479, 481, 483, 487, 503, 544, 549, 631, 647, 669–673, 705
   CsmData.py28389%13, 80–82
   DcfData.py44882%16, 64, 76–81
   EncodingLimits.py73396%33, 123, 126
   IData.py67987%119, 125, 129, 159–167
   IHeader.py75791%75, 109, 127–131
   KData.py2223385%112–113, 128, 135, 147–158, 167, 175, 184–188, 240–241, 281, 298, 303–304, 323–334, 487, 489, 547, 562, 626, 635
   KHeader.py1391986%23, 108–112, 139, 187, 194–195, 198, 205, 222–229, 237–248
   KNoise.py311552%39–52, 56–61
   KTrajectory.py811285%108–113, 116–118, 203–207
   MoveDataMixin.py1401887%15, 113, 129, 143–145, 207, 323–325, 338, 417, 437–438, 440, 455–456, 458
   QData.py39782%42, 65–73
   Rotation.py6743595%100, 198, 335, 433, 477, 495, 581, 583, 592, 626, 628, 691, 768, 773, 776, 791, 808, 813, 889, 1077, 1082, 1085, 1109, 1113, 1240, 1242, 1250–1251, 1315, 1397, 1690, 1846, 1881, 1885, 1996
   SpatialDimension.py2322191%34, 104, 141, 148, 154, 274–276, 289–291, 325, 343, 356, 369, 382, 395, 404–405, 420, 429
   acq_filters.py12192%47
src/mrpro/data/traj_calculators
   KTrajectoryCalculator.py27196%85
   KTrajectoryIsmrmrd.py13285%41, 50
src/mrpro/operators
   CartesianSamplingOp.py89397%118, 157, 280
   ConstraintsOp.py60297%46, 48
   EndomorphOperator.py65297%228, 234
   FiniteDifferenceOp.py27293%40, 105
   FourierOp.py158398%263, 381, 386
   Functional.py71593%20–22, 117, 119
   GridSamplingOp.py136993%72–73, 82–83, 90–91, 94, 96, 98
   LinearOperator.py1681094%55, 91, 190, 220, 261, 270, 278, 287, 295, 320
   LinearOperatorMatrix.py1581690%82, 119, 152, 161, 166, 175–178, 191–194, 203, 215, 304, 331, 359
   MultiIdentityOp.py13285%43, 48
   Operator.py78297%25, 74
   ProximableFunctionalSeparableSum.py39392%50, 103, 110
   SliceProjectionOp.py173895%44, 61, 63, 69, 206, 227, 260, 300
   WaveletOp.py120596%152, 170, 205, 210, 233
   ZeroPadOp.py16194%30
src/mrpro/utils
   filters.py62297%44, 49
   indexing.py170199%325
   reshape.py60198%191
   slice_profiles.py46687%20, 36, 113–116, 149
   sliding_window.py34197%34
   split_idx.py10280%43, 47
   summarize_tensorvalues.py11918%20–29
   typing.py181139%8–23
   zero_pad_or_crop.py31681%26, 30, 54, 57, 60, 63
TOTAL540541092% 

Tests Skipped Failures Errors Time
2323 0 💤 0 ❌ 0 🔥 1m 50s ⏱️

Copy link
Contributor

github-actions bot commented Dec 16, 2024

📚 Documentation

📁 Download as zip
🔍 View online

[ghstack-poisoned]
fzimmermann89 added a commit that referenced this pull request Dec 16, 2024
ghstack-source-id: bbf8a4d9d05a3021b601c9ddcb480bb59911604d
ghstack-comment-id: 2544442894
Pull Request resolved: #580
@fzimmermann89 fzimmermann89 changed the title Indexing helper Add Indexing helper Dec 16, 2024
@fzimmermann89 fzimmermann89 changed the title Add Indexing helper Add Indexer Dec 16, 2024
fzimmermann89 added a commit that referenced this pull request Dec 16, 2024
ghstack-source-id: bbf8a4d9d05a3021b601c9ddcb480bb59911604d
ghstack-comment-id: 2544442894
Pull Request resolved: #580
[ghstack-poisoned]
fzimmermann89 added a commit that referenced this pull request Dec 16, 2024
ghstack-source-id: 49a21ca903359888a8e47e8ac9be7494558539d6
ghstack-comment-id: 2544442894
Pull Request resolved: #580
[ghstack-poisoned]
fzimmermann89 added a commit that referenced this pull request Dec 16, 2024
ghstack-source-id: c693fa21344f76ec98985f865dc3e61f7b113f1d
ghstack-comment-id: 2544442894
Pull Request resolved: #580
[ghstack-poisoned]
@fzimmermann89 fzimmermann89 mentioned this pull request Dec 23, 2024
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
@fzimmermann89 fzimmermann89 mentioned this pull request Dec 29, 2024
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
[ghstack-poisoned]
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.

1 participant