Skip to content

Commit

Permalink
fixed affine for ACR templates when varried image input
Browse files Browse the repository at this point in the history
  • Loading branch information
pjmark committed Aug 3, 2024
1 parent c52d9a6 commit 48d56b8
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions niftypet/nimpa/acr/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,17 @@ def create_nac_core(Cntd, return_raw=False):
# > affine
imxys = acrad.shape[2]
imzys = acrad.shape[0]
flpx, flpy, flpz = imupd['flip']
affined = np.array(
[[-Cntd['vxsz'] * Cntd['scld'], 0., 0., .5 * imxys * Cntd['vxsz'] * Cntd['scld']],
[0., Cntd['vxsz'] * Cntd['scld'], 0., -.5 * imxys * Cntd['vxsz'] * Cntd['scld']],
[0., 0., Cntd['vxsz'] * Cntd['scld'], -.5 * imzys * Cntd['vxsz'] * Cntd['scld']],
[[flpx*Cntd['vxsz'] * Cntd['scld'], 0., 0., -.5 * flpx * imxys * Cntd['vxsz'] * Cntd['scld']],

Check failure on line 310 in niftypet/nimpa/acr/templates.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] niftypet/nimpa/acr/templates.py#L310

E501 line too long (103 > 99 characters)
Raw output
niftypet/nimpa/acr/templates.py:310:100: E501 line too long (103 > 99 characters)
[0., flpy*Cntd['vxsz'] * Cntd['scld'], 0., -.5 * flpy * imxys * Cntd['vxsz'] * Cntd['scld']],

Check failure on line 311 in niftypet/nimpa/acr/templates.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] niftypet/nimpa/acr/templates.py#L311

E501 line too long (102 > 99 characters)
Raw output
niftypet/nimpa/acr/templates.py:311:100: E501 line too long (102 > 99 characters)
[0., 0., flpz*Cntd['vxsz'] * Cntd['scld'], -.5 * flpz * imzys * Cntd['vxsz'] * Cntd['scld']],

Check failure on line 312 in niftypet/nimpa/acr/templates.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] niftypet/nimpa/acr/templates.py#L312

E501 line too long (102 > 99 characters)
Raw output
niftypet/nimpa/acr/templates.py:312:100: E501 line too long (102 > 99 characters)
[0., 0., 0., 1.]])

nimpa.array2nii(
acrad, affined, Cntd['out']['facrad'],
trnsp=(imupd['transpose'].index(0), imupd['transpose'].index(1),
imupd['transpose'].index(2)), flip=imupd['flip'])
trnsp=imupd['transpose'],

Check failure on line 317 in niftypet/nimpa/acr/templates.py

View workflow job for this annotation

GitHub Actions / flake8

[flake8] niftypet/nimpa/acr/templates.py#L317

W291 trailing whitespace
Raw output
niftypet/nimpa/acr/templates.py:317:34: W291 trailing whitespace
flip=imupd['flip'])

# matshow(acrad[420,...], cmap='magma')
# matshow(imup['im'][420,...], cmap='magma')
Expand Down

0 comments on commit 48d56b8

Please sign in to comment.