Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor corrections #265

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5efc805
keep_gcc_bin_mask
davidmeunier79 Oct 3, 2024
26ab936
IsoSurface gcc
davidmeunier79 Oct 3, 2024
0dda6ca
crop_T1 as optionnal before crop_aladin
davidmeunier79 Oct 3, 2024
e5bbd9a
native is crop if crop_T1
davidmeunier79 Oct 3, 2024
2707b01
..
davidmeunier79 Oct 3, 2024
332d63a
pad_back
davidmeunier79 Oct 3, 2024
5b4663d
stereo_padded really denoise
davidmeunier79 Oct 14, 2024
a477311
no inversion at the end (use T2)
davidmeunier79 Oct 14, 2024
8d2f07a
no inverese T1/T2 before the end
davidmeunier79 Oct 14, 2024
5f14705
print for bug pad_template
davidmeunier79 Oct 29, 2024
0e47a00
padded is raw data
davidmeunier79 Oct 29, 2024
507f868
Taubin smoothing 0.2
davidmeunier79 Oct 30, 2024
d552098
0.4
davidmeunier79 Oct 30, 2024
ea84fa9
modifying parameters
davidmeunier79 Oct 30, 2024
0085f77
0.6
davidmeunier79 Oct 30, 2024
b6adb05
0.01
davidmeunier79 Oct 30, 2024
42379e9
0.001 1000
davidmeunier79 Oct 30, 2024
fabf215
0.0001 10000
davidmeunier79 Oct 30, 2024
f6f8e71
relaunching with curl modif
davidmeunier79 Nov 4, 2024
7883044
relaunch GA
davidmeunier79 Nov 4, 2024
93c2688
relaunch pytest
davidmeunier79 Nov 4, 2024
0076477
launch PR
davidmeunier79 Nov 4, 2024
1102595
pr
davidmeunier79 Nov 4, 2024
1f0bcfe
template head even for crop_T1
davidmeunier79 Nov 4, 2024
b841557
test_prepare
davidmeunier79 Nov 4, 2024
366afdd
flake8
davidmeunier79 Nov 4, 2024
e9fd02f
Merge branch 'master' into some_minor_corrections
davidmeunier79 Nov 4, 2024
7110dc4
flake8
davidmeunier79 Nov 4, 2024
dbcb41e
Merge branch 'master' into some_minor_corrections
davidmeunier79 Nov 4, 2024
857cb0c
pr
davidmeunier79 Nov 4, 2024
7a9df68
crop_T1 and crop_aladin for ANTS_T1
davidmeunier79 Nov 4, 2024
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
63 changes: 17 additions & 46 deletions macapype/nodes/pad.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,57 +16,28 @@ def pad_back(seg_pipe, data_preparation_pipe, inputnode,
pad_nodename = "pad_" + outputnodefile

if "short_preparation_pipe" in params.keys():
if "crop_T1" in params["short_preparation_pipe"].keys():

print("Padding mask in native space")
pad_node = pe.Node(
niu.Function(
input_names=[
'cropped_img_file',
'orig_img_file',
'indiv_crop'],
output_names=['padded_img_file'],
function=padding_cropped_img),
name=pad_nodename)

seg_pipe.connect(
node, nodefile,
pad_node, "cropped_img_file")

seg_pipe.connect(
data_preparation_pipe, "outputnode.native_T1",
pad_node, "orig_img_file")
print("Using reg_aladin transfo to pad mask back")
pad_node = pe.Node(
RegResample(inter_val="NN"),
name=pad_nodename)

seg_pipe.connect(
inputnode, "indiv_params",
pad_node, "indiv_crop")

seg_pipe.connect(
pad_node, "padded_img_file",
outputnode, outputnodefile)

else:
print("Using reg_aladin transfo to pad mask back")
pad_node = pe.Node(
RegResample(inter_val="NN"),
name=pad_nodename)
seg_pipe.connect(
node, nodefile,
pad_node, "flo_file")

seg_pipe.connect(
node, nodefile,
pad_node, "flo_file")
seg_pipe.connect(
data_preparation_pipe, "outputnode.native_T1",
pad_node, "ref_file")

seg_pipe.connect(
data_preparation_pipe, "outputnode.native_T1",
pad_node, "ref_file")
seg_pipe.connect(
data_preparation_pipe, "inv_tranfo.out_file",
pad_node, "trans_file")

seg_pipe.connect(
data_preparation_pipe, "inv_tranfo.out_file",
pad_node, "trans_file")

# outputnode
seg_pipe.connect(
pad_node, "out_file",
outputnode, outputnodefile)
# outputnode
seg_pipe.connect(
pad_node, "out_file",
outputnode, outputnodefile)

elif "long_single_preparation_pipe" in params.keys():
if "prep_T1" in params["long_single_preparation_pipe"].keys():
Expand Down
11 changes: 3 additions & 8 deletions macapype/nodes/surface.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
from nipype.interfaces.base import TraitedSpec, SimpleInterface
from nipype.interfaces.base import traits, File
from nipype.interfaces.base import (TraitedSpec, SimpleInterface, traits, File)


def keep_gcc(nii_file):

import os
import nibabel as nib
import numpy as np

from nipype.utils.filemanip import split_filename as split_f

def getLargestCC(segmentation):
Expand All @@ -28,8 +25,6 @@ def getLargestCC(segmentation):
data[data > 0] = 1
binary = np.array(data, dtype="bool")

# skimage

# skimage GCC
new_data = getLargestCC(binary)

Expand Down Expand Up @@ -135,8 +130,8 @@ def wrap_afni_IsoSurface(nii_file):
remesh = 0.5

# Tsmooth
KPB = 0.1
NITER = 100
KPB = 0.0001
NITER = 10000

# remesh
remesh = 0.5
Expand Down
Loading
Loading