Skip to content

Commit

Permalink
fixed crude LR mask to have correct values assigned (1 for L hemi/rig…
Browse files Browse the repository at this point in the history
…ht side of image and 2 for R hemi/left side of image)
  • Loading branch information
LuciMoore committed Feb 15, 2024
1 parent ce00b2e commit a0d92f5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/postbibsnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,9 @@ def create_crude_LR_mask(sub_ses, j_args):
midpoint_x = data.shape[0] // 2
modified_data = np.zeros_like(data)

# Assign value 1 to left-side voxels with values greater than 0 value 2 to right-side voxels with values greater than 0
modified_data[:midpoint_x, :, :][data[:midpoint_x, :, :] > 0] = 1
modified_data[midpoint_x:, :, :][data[midpoint_x:, :, :] > 0] = 2
# Assign value 1 to right-side voxels with values greater than 0 value 2 to left-side voxels with values greater than 0 (note that these actually correspond to left and right brain hemispheres respectively)
modified_data[midpoint_x:, :, :][data[midpoint_x:, :, :] > 0] = 1
modified_data[:midpoint_x, :, :][data[:midpoint_x, :, :] > 0] = 2

#nib.save(img, seg_BIBSnet_outfiles[0])
save_nifti(modified_data, affine, crude_left_right_mask_nifti_fpath)
Expand Down

0 comments on commit a0d92f5

Please sign in to comment.