Skip to content

Commit

Permalink
save the warped mask in template directory
Browse files Browse the repository at this point in the history
so far it was being saved in input mask directory, which is inconsistent with the location of other warped images
  • Loading branch information
tashrifbillah committed Mar 1, 2020
1 parent f27090f commit 88a69d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/buildTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def warp_bands(imgPath, maskPath, templatePath):
applyXform(maskPath,
pjoin(templatePath, 'template0.nii.gz'),
warp, trans,
pjoin(templatePath, abspath(maskPath).split('.nii')[0]+ 'Warped.nii.gz'))
pjoin(templatePath, basename(maskPath).split('.nii')[0]+ 'Warped.nii.gz'))


# warping the rish features
Expand Down Expand Up @@ -101,7 +101,7 @@ def dti_stat(siteName, imgs, masks, templatePath, templateHdr):

maskData = []
for maskPath in masks:
maskData.append(load_nifti(pjoin(templatePath, abspath(maskPath).split('.nii')[0] + 'Warped.nii.gz'))[0])
maskData.append(load_nifti(pjoin(templatePath, basename(maskPath).split('.nii')[0] + 'Warped.nii.gz'))[0])


morphed_mask= binary_opening(np.mean(maskData, axis= 0)>0.5, structure= generate_binary_structure(3,1))*1
Expand Down

0 comments on commit 88a69d1

Please sign in to comment.