Skip to content

Commit

Permalink
dwicat: Bug fix for matching voxel grid
Browse files Browse the repository at this point in the history
Script was erroneously triggering the use of rigid body average header generation due to the input series containing different numbers of volumes.
  • Loading branch information
Lestropie committed Feb 28, 2024
1 parent 97e12d0 commit d686ba1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions python/bin/dwicat
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def execute(): #pylint: disable=unused-variable
check_header(this_header)
if max(abs(a-b) for a, b in zip(this_header.spacing()[0:3], first_header.spacing()[0:3])) > 1e-5 or this_header.size()[0:3] != first_header.size()[0:3]:
voxel_grid_matching = 'inequal'
elif voxel_grid_matching == 'equal' and not image.match(this_header, first_header):
elif voxel_grid_matching == 'equal' and not image.match(this_header, first_header, up_to_dim=3):
voxel_grid_matching = 'rigidbody'
for field_name in BZERO_CONTRAST_FIELDS:
first_value = first_header.keyval().get(field_name)
Expand All @@ -112,17 +112,17 @@ def execute(): #pylint: disable=unused-variable
bzero_contrast_mismatch = True
if voxel_grid_matching == 'rigidbody':
app.console('Rigid-body difference in header transforms found between input series;')
app.console('series will need to be rigid-body transformed to average header space')
app.console(' series will need to be rigid-body transformed to average header space')
elif voxel_grid_matching == 'inequal':
app.console('Incompatible voxel grids between input series;')
app.console('data will be resampled onto a new average header space')
app.console(' data will be resampled onto a new average header space')
else:
assert voxel_grid_matching == 'equal'
app.console('Input images are already on the same voxel grid;')
app.console('series will be concatenated with no transformation applied')
app.console(' series will be concatenated with no transformation applied')
if bzero_contrast_mismatch:
app.warn('Mismatched protocol acquisition parameters detected between input images;')
app.warn('since b=0 images may have different intensities / contrasts, intensity matching across series will not be performed')
app.warn(' since b=0 images may have different intensities / contrasts, intensity matching across series will not be performed')
do_intensity_matching = False
if app.ARGS.mask:
if voxel_grid_matching != 'equal':
Expand Down

0 comments on commit d686ba1

Please sign in to comment.