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

Correct reg aladin values #260

Merged
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
d6ea53d
node remove_fake_values instead of FSL function for node remove_nans
davidmeunier79 Apr 18, 2024
08963a0
go further in hist
davidmeunier79 Apr 18, 2024
eb05a55
find_peaks
davidmeunier79 Apr 18, 2024
2fdd7a1
distance
davidmeunier79 Apr 18, 2024
e1a0e52
Xmin
davidmeunier79 Apr 18, 2024
f8366a6
*10
davidmeunier79 Apr 18, 2024
98e363e
/10
davidmeunier79 Apr 18, 2024
06b3ea6
maxima not minima
davidmeunier79 Apr 18, 2024
423dd26
filter and save
davidmeunier79 Apr 18, 2024
1f331e3
and
davidmeunier79 Apr 18, 2024
055d636
bins[peaks[index_peak]]
davidmeunier79 Apr 18, 2024
5670f05
it works !!!
davidmeunier79 Apr 18, 2024
eccb697
changed remove_fake_values to pad biiger and reg_resample...
davidmeunier79 Apr 22, 2024
1522970
import pad_zero_mri
davidmeunier79 Apr 22, 2024
e6d404e
outputnode
davidmeunier79 Apr 22, 2024
aae85b4
testing pad_val = "double"
davidmeunier79 Apr 22, 2024
9526aa2
int
davidmeunier79 Apr 22, 2024
7b16f04
pad_val
davidmeunier79 Apr 22, 2024
51021b6
pad_val
davidmeunier79 Apr 22, 2024
bdd3d16
op1
davidmeunier79 Apr 22, 2024
2fe9eea
output_image
davidmeunier79 Apr 22, 2024
60bf58c
op2
davidmeunier79 Apr 22, 2024
34982e1
string
davidmeunier79 Apr 22, 2024
d8e78fa
working for T1, apply to T2 (in prepare)
davidmeunier79 Apr 22, 2024
84a6f13
reg_resample_T2, 'out_file'
davidmeunier79 Apr 22, 2024
70d8b60
pad_image_T2
davidmeunier79 Apr 22, 2024
b773715
if template_files = 2, for no priors
davidmeunier79 Apr 23, 2024
bda11f9
no reg /animal_warp if no priors
davidmeunier79 Apr 23, 2024
3a968f3
working on flist average
davidmeunier79 Apr 24, 2024
54969ac
no safe casting
davidmeunier79 Apr 24, 2024
54620b3
ok
davidmeunier79 Apr 24, 2024
f5c390b
if and assert
davidmeunier79 Apr 24, 2024
a57caa8
bug
davidmeunier79 Apr 24, 2024
b78fba1
avg_shape
davidmeunier79 Apr 24, 2024
cc3de43
nib.load
davidmeunier79 Apr 24, 2024
80a337e
error
davidmeunier79 Apr 24, 2024
98267c4
extra
davidmeunier79 Apr 24, 2024
1026e50
flake8
davidmeunier79 Apr 24, 2024
f4d3555
forcing int16 type in average
davidmeunier79 Apr 25, 2024
d3734bc
shape
davidmeunier79 Apr 25, 2024
99d1c9d
aff
davidmeunier79 Apr 25, 2024
6ab2f06
AFF TRANS
davidmeunier79 Apr 25, 2024
563d5ea
,
davidmeunier79 Apr 25, 2024
d0fa8d7
print
davidmeunier79 May 13, 2024
7a41e39
k = True
davidmeunier79 May 13, 2024
d718b30
padval
davidmeunier79 May 15, 2024
2fd004d
removed k position=3
davidmeunier79 May 16, 2024
33dda11
also p
davidmeunier79 May 16, 2024
e07ac4c
bug crop_z_t1 -> pre_crop_z_t1
davidmeunier79 May 21, 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
Prev Previous commit
Next Next commit
find_peaks
  • Loading branch information
davidmeunier79 committed Apr 18, 2024
commit eb05a55c1a19a14198a78ae430da9a691a9b80f2
14 changes: 5 additions & 9 deletions macapype/nodes/register.py
Original file line number Diff line number Diff line change
@@ -20,7 +20,8 @@ def remove_fake_values(in_file):
import nibabel as nib
import numpy as np

sample_bins = 10000
#sample_bins = 10000
distance = 1

img_nii = nib.load(in_file)
img_arr = np.array(img_nii.dataobj)
@@ -37,7 +38,7 @@ def remove_fake_values(in_file):

print("Round X max : ", np.round(np.max(X)))

nb_bins = (np.rint(np.max(X)*100)).astype(int)
nb_bins = (np.rint(np.max(X)*1)).astype(int)
print("Nb bins: ", nb_bins)

# Create a histogram
@@ -52,21 +53,16 @@ def remove_fake_values(in_file):
plt.savefig(os.path.abspath('histogram.png'))
plt.clf()

0/0

# Find local minima in the histogram
peaks, _ = find_peaks(-hist, distance=distance)
peaks, properties = find_peaks(-hist, distance=distance)
# Use negative histogram for minima

print("peaks indexes :", peaks)

print("peak_hist :", hist[peaks])
print("peak_bins :", bins[peaks])

f.write("peaks indexes : {}\n".format(peaks))
f.write("peak_hist : {}\n".format(hist[peaks]))
f.write("peak_bins : {}\n".format(bins[peaks]))

0/0

return out_file