diff --git a/notebooks/crash-20200902-170910-hkebiri-Multiple_Brain_extraction-b18e8797-786c-468f-8422-39c9a03c92b7.pklz b/notebooks/crash-20200902-170910-hkebiri-Multiple_Brain_extraction-b18e8797-786c-468f-8422-39c9a03c92b7.pklz deleted file mode 100644 index a164075f3..000000000 Binary files a/notebooks/crash-20200902-170910-hkebiri-Multiple_Brain_extraction-b18e8797-786c-468f-8422-39c9a03c92b7.pklz and /dev/null differ diff --git a/notebooks/crash-20200902-182548-hkebiri-Multiple_Brain_extraction-94bdeb49-6c0b-47f5-9a03-ddeb8f3fe5d8.pklz b/notebooks/crash-20200902-182548-hkebiri-Multiple_Brain_extraction-94bdeb49-6c0b-47f5-9a03-ddeb8f3fe5d8.pklz deleted file mode 100644 index 830974719..000000000 Binary files a/notebooks/crash-20200902-182548-hkebiri-Multiple_Brain_extraction-94bdeb49-6c0b-47f5-9a03-ddeb8f3fe5d8.pklz and /dev/null differ diff --git a/pymialsrtk/interfaces/preprocess.py b/pymialsrtk/interfaces/preprocess.py index 64504a7b3..39b411edf 100644 --- a/pymialsrtk/interfaces/preprocess.py +++ b/pymialsrtk/interfaces/preprocess.py @@ -694,7 +694,8 @@ def _extractBrain(self, dataPath, modelCkptLoc, thresholdLoc, modelCkptSeg, thre img_nib = nibabel.load(os.path.join(dataPath)) image_data = img_nib.get_data() images = np.zeros((image_data.shape[2], width, height, n_channels)) - pred3dFinal = np.zeros((image_data.shape[2], width, height, n_channels)) + #pred3dFinal = np.zeros((image_data.shape[2], width, height, n_channels)) + pred3dFinal = np.zeros((image_data.shape[2], image_data.shape[0], image_data.shape[1], n_channels)) slice_counter = 0 for ii in range(image_data.shape[2]): @@ -801,7 +802,7 @@ def _extractBrain(self, dataPath, modelCkptLoc, thresholdLoc, modelCkptSeg, thre for i in range(np.asarray(pred3d).shape[0]): if np.sum(pred3d[i, :, :]) != 0: pred3d[i, :, :] = self._extractLargestCC(pred3d[i, :, :].astype('uint8')) - contours, _ = cv2.findContours(pred3d[i, :, :].astype('uint8'), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) + contours, hierarchy = cv2.findContours(pred3d[i, :, :].astype('uint8'), cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE) area = cv2.minAreaRect(np.squeeze(contours)) heights.append(area[1][0]) widths.append(area[1][1])