Commit 402e806f authored by Thomas Vincent's avatar Thomas Vincent

use image roi to test if image size is OK for maxipix correction

parent 3e49671e
......@@ -604,6 +604,8 @@ class QSpaceConverter(object):
# Load image ROI from first entry
image_roi_offset = first_param['image_roi_offset']
if image_roi_offset is None: # No image ROI offset
image_roi_offset = 0, 0
n_images = first_param['n_images']
if n_images is None or n_images == 0:
......@@ -622,8 +624,6 @@ class QSpaceConverter(object):
# Mask is empty, disable mask
mask = None
else:
if (image_roi_offset is not None and
image_roi_offset != (0, 0)):
# Apply image ROI to mask
row, column = image_roi_offset
mask = mask[row[0]:row[0]+img_size[0],
......@@ -631,8 +631,9 @@ class QSpaceConverter(object):
if mask.shape != img_size:
raise ValueError('Invalid mask size')
# TODO image ROI correction
if self.maxipix_correction and (img_size[0] > 516 or img_size[1] > 516):
if self.maxipix_correction and (
image_roi_offset[0] + img_size[0] > 516 or
image_roi_offset[1] + img_size[1] > 516):
# Maxipix correction for something else
raise ValueError('Invalid image size for Maxipix correction')
......@@ -669,7 +670,6 @@ class QSpaceConverter(object):
print('\t- qspace size : {0}'.format(qspace_dims))
# Offset center_chan with image roi offset if any
if image_roi_offset is not None:
center_chan = (center_chan[0] - image_roi_offset[0],
center_chan[1] - image_roi_offset[1])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment