Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
4d91287
parcel for marmo
davidmeunier79 Dec 15, 2025
475d1ac
reg / nonlinreg
davidmeunier79 Dec 15, 2025
b1990c2
added nonlin_warp_file and nonlin_invwarp_file as non mandatory outputs
davidmeunier79 Dec 15, 2025
b78bd01
using nonlin version
davidmeunier79 Dec 17, 2025
99e76ad
modif params lower3
davidmeunier79 Dec 17, 2025
da270fb
stderr
davidmeunier79 Dec 17, 2025
8e19afe
removed denoise for ants_4animal
davidmeunier79 Dec 17, 2025
aef3f24
reg_f3d
davidmeunier79 Dec 17, 2025
80120d6
()
davidmeunier79 Dec 17, 2025
4f96bbb
reg_f3d
davidmeunier79 Dec 17, 2025
49fafb5
reg_f3d
davidmeunier79 Dec 17, 2025
585a7f9
parcel and parcel_gm
davidmeunier79 Dec 18, 2025
5ad7648
'outputnode.threshold_gm',
davidmeunier79 Dec 18, 2025
89c8022
'outputnode.threshold_gm',
davidmeunier79 Dec 18, 2025
be94b11
merge dseg dtype
davidmeunier79 Dec 18, 2025
f35aae4
dtype
davidmeunier79 Dec 18, 2025
a19d6ac
np.int
davidmeunier79 Dec 18, 2025
38c2e2f
np.int32
davidmeunier79 Dec 18, 2025
1793066
threshold gm
davidmeunier79 Dec 18, 2025
4f66d08
parcel_gm
davidmeunier79 Dec 18, 2025
b80f079
params["brain_segment_pipe"]:
davidmeunier79 Dec 18, 2025
416b441
in params["brain_segment_pipe"]:
davidmeunier79 Dec 18, 2025
f896dc6
in params["brain_segment_pipe"]:
davidmeunier79 Dec 18, 2025
2947557
parcel
davidmeunier79 Dec 19, 2025
b484029
parcel
davidmeunier79 Dec 19, 2025
8b49c22
sub
davidmeunier79 Dec 19, 2025
5f7c6aa
removed
davidmeunier79 Dec 19, 2025
bd16077
stereo_parcel
davidmeunier79 Dec 19, 2025
4c7918d
removed parcl changed json
davidmeunier79 Dec 19, 2025
b012dc7
native parcel_gm
davidmeunier79 Dec 22, 2025
a1c7037
native_parcel_gm
davidmeunier79 Dec 22, 2025
6fa7b46
no native_parcel_gm
davidmeunier79 Dec 22, 2025
4ea26c8
testing premat
davidmeunier79 Dec 22, 2025
c5e43a8
intermediate params
davidmeunier79 Dec 22, 2025
2673ea9
pass
davidmeunier79 Dec 22, 2025
a9f8680
no premat
davidmeunier79 Dec 22, 2025
9d2b90f
full reg
davidmeunier79 Dec 22, 2025
2e6302f
using linear flirt and checking
davidmeunier79 Dec 22, 2025
a8f42da
nn
davidmeunier79 Dec 22, 2025
7329d84
comment
davidmeunier79 Dec 22, 2025
dc9e80b
reference
davidmeunier79 Dec 22, 2025
d0e09af
template_MBM_space-stereoINTv2
davidmeunier79 Jan 6, 2026
b8d8071
flake8
davidmeunier79 Jan 6, 2026
3e4fe35
brain_segment_pipe
davidmeunier79 Jan 9, 2026
d46cc01
seg_pipe_name
davidmeunier79 Jan 9, 2026
100c992
rename
davidmeunier79 Jan 9, 2026
e1d13f0
flake8
davidmeunier79 Jan 9, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions macapype/bash/IterREGBET.sh
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,13 @@ for ((i = 1 ; i <= $NITER ; i++)); do

# Extra whole-head non-linear registration, if wanted
if [[ -n $REF_WHOLE ]] && [[ $i == $NITER ]]; then
echo "FNIRT..."
echo "FNIRT..." 1>&2
"${FSLPREFIX}fnirt" --in=$IN_WHOLE --ref=$REF_WHOLE --aff=$I2R_XFM --iout=${WARP[WH_OUT]} --cout=${WARP[WH_WARP]} # compute warp
echo "Inverting warp..."
#"${FSLPREFIX}fnirt" --in=$IN_WHOLE --ref=$REF_WHOLE --aff=$I2R_XFM --iout=${WARP[WH_OUT]} --cout=${WARP[WH_WARP]} --miter=5,3 --subsamp=4,2 --infwhm=6,4 --reffwhm=4,2 --estint=false --applyrefmask=false --applyinmask=false # compute warp
#"${FSLPREFIX}fnirt" --in=$IN_WHOLE --ref=$REF_WHOLE --aff=$I2R_XFM --iout=${WARP[WH_OUT]} --cout=${WARP[WH_WARP]} --miter=1 --subsamp=4 --infwhm=6 --reffwhm=4 --estint=false --applyrefmask=false --applyinmask=false # compute warp
echo "Inverting warp..." 1>&2
"${FSLPREFIX}invwarp" -r $IN_WHOLE -w ${WARP[WH_WARP]} -o ${WARP[WH_INVWARP]}
echo "Applying inverse warp..."
echo "Applying inverse warp..." 1>&2
"${FSLPREFIX}applywarp" --ref=$IN_WHOLE --in=${TMP[REF_MASK]} --out=$IN_OUT_MASK --warp=${WARP[WH_INVWARP]} --interp=nn
else
"${FSLPREFIX}flirt" -in ${TMP[REF_MASK]} -ref $IN_WHOLE -out $IN_OUT_MASK -interp nearestneighbour -applyxfm -init $R2I_XFM # move brain mask to in_file
Expand Down
14 changes: 14 additions & 0 deletions macapype/nodes/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ class IterREGBETOutputSpec(TraitedSpec):
exists=True,
desc="inv_transfo_file")

nonlin_warp_file = File(
desc="nonlin_warp_file")

nonlin_invwarp_file = File(
desc="nonlin_invwarp_file")


class IterREGBET(CommandLine):
"""
Expand Down Expand Up @@ -334,8 +340,16 @@ def _list_outputs(self):
outfile = self._gen_outfilename()

outputs["warp_file"] = os.path.abspath(outfile + ".nii.gz")

outputs["transfo_file"] = os.path.abspath(outfile + ".xfm")
outputs["inv_transfo_file"] = os.path.abspath(outfile + "_inverse.xfm")

if isdefined(self.inputs.refw_file) and self.inputs.k is True:
outputs["nonlin_warp_file"] = \
os.path.abspath(outfile + "_Warp.nii.gz")
outputs["nonlin_invwarp_file"] = \
os.path.abspath(outfile + "_InverseWarp.nii.gz")

return outputs


Expand Down
7 changes: 4 additions & 3 deletions macapype/nodes/segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,15 +248,16 @@ def merge_imgs(list_img_files):
path, fname, ext = split_f(img_file)
img = nib.load(img_file)
img_data = img.get_fdata()
new_img_data = np.zeros(shape=img_data.shape)
new_img_data[img_data != 0] += img_data[img_data != 0]
new_img_data = np.zeros(shape=img_data.shape, dtype=np.int32)
new_img_data[img_data != 0] = 1

else:
img_data = nib.load(img_file).get_fdata()

assert img_data.shape == new_img_data.shape, \
"Error, shapes {} != {}".format(img_data.shape,
new_img_data.shape)
new_img_data[img_data != 0] += img_data[img_data != 0]
new_img_data[img_data != 0] = 1

# creating indexed_mask
merged_img = nib.Nifti1Image(dataobj=new_img_data,
Expand Down
Loading