Skip to content

Commit

Permalink
trying another density_weight shape fix
Browse files Browse the repository at this point in the history
  • Loading branch information
evgueni-ovtchinnikov committed Jun 19, 2024
1 parent 74aa948 commit 8e8d95b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/xGadgetron/pGadgetron/Gadgetron.py
Original file line number Diff line number Diff line change
Expand Up @@ -1856,17 +1856,10 @@ def calc_cartesian_dcw(ad):

density_weight = (1.0 / counts)[inverse]
print(density_weight.shape)
l = len(density_weight.shape)
print(l)
if l > 1:
n = numpy.prod(density_weight.shape)
density_weight.reshape((n,))
n = numpy.prod(density_weight.shape)
density_weight = density_weight.reshape((n, 1, 1))
print(density_weight.shape)

density_weight = numpy.expand_dims(density_weight, axis=1)
print(density_weight.shape)
density_weight = numpy.expand_dims(density_weight, axis=2)
print(density_weight.shape)
print(ad.shape)
density_weight = numpy.tile(density_weight, (1, ad.shape[1], ad.shape[2]))
print(density_weight.shape)
Expand Down

0 comments on commit 8e8d95b

Please sign in to comment.