Download presentation
Presentation is loading. Please wait.
1
Linear_Transforms (stage 1 ~ 6)
Note: Compute the transformations necessary to bring source images into MNI-Talairach space. Linear_Transforms (stage 1 ~ 6)
2
Linear_transforms.pm # Compute the transformations necessary to bring source images into MNI-Talairach space. sub stx_register { nuc_t1_native (#stage 1) skull_masking_native (#stage 2) stx_register (#stage 3) stx_tal_to_7 (#stage 4) stx_tal_to_6 (#stage 5) } # Since the transformations necessary to bring source images into MNI-Talairach # space had been computed in the previous stages, now we need to 'resample' the # images, essentially applying the computed transformation on the actual images. sub transform { tal_t1 (#stage 6)
3
1. nuc_[t1]_native 모듈: Linear_Transform.pm
Label: "non-uniformity correction on native [t1]" 실행명령: progs/nuc_inorm_stage(s) in.mnc out.mnc none bin/nu_correct(s) bin/nu_estimate_np_and_em (s) bin/nu_evaluate (s) bin/make_template (s) bin/minc_modify_header bin/minccalc 입력: /gpfs5/jinju/civet/jj_t1.mnc 출력: /gpfs5/jinju/civet/jj_t1_nuc.mnc 의존성:
4
In the arguments, $nuc_dist is the distance between knots in the b-spline.
# The accuracy of nu_correct is quite sensitive to this distance. A small # value is more accurate, but it must not be chosen too small so as not to # remove biological variations. The smaller d is, the longer the code will # take to run. Accuracy is not free. In the old version, d=200 was used and # this created hot spots in the corrected images when the spline was not able # to represent non-uniformities at a smaller wavelength. (This likely depends # on the scanner too.) In the new way, d=25 to 50 seems to give reliable # results. The smoothness of the approximation is determined by two parameters: ω, referred to as the smoothing parameter, d, the distance between basis functions. Since the normalization of the Bspline has been chosen to eliminate the dependence of ω on scale and number of data points, ω can be fixed and the distance between basis functions varied instead.
5
nuc_inorm_stage (stage 1)
# Important note: Because of the way nu_correct converges, it is better to # do a few sets of 100 iterations rather than a total number of iterations # at once. For example, nu_correct often thinks it has converged after 50-60 # iterations, so repeating the cycle will provide more iterations. Please # leave as it is until nu_correct is fixed. for( my $i = 0; $i < $nuc_cycles; $i++ ) { &run( "nu_correct", "-clobber", "-iter", $nuc_iters, "-stop", , "-fwhm", 0.1, "-distance", $tmp_input, $output ); &run( "mv", "-f", $output, $tmp ); $tmp_input = $tmp; # Clear minc history to avoid a bug in netCDF (see Claude) &run( "minc_modify_header", "-sinsert", ":history=\"\"", $tmp ); } … # remove high extremum (low extremum - background - will be taken care of by the mask). my $top; my $upper = 99.50; chomp($top = `mincstats -quiet -pctT $upper $tmp`); my $clip_expr = "if(A[0]<0){out=0;}else{if(A[0]>${top}){out=${top};}else{out=A[0];}}"; &run( "minccalc", "-clobber", "-expression", $clip_expr, $tmp, $output );
6
nuc_inorm_stage.log nu_correct -clobber -iter 100 -stop fwhm 0.1 -distance 200 /gpfs5/jinju/civet/jj_t1.mnc /gpfs5/jinju/civet/jj_t1_nuc.mnc [ :23:22] running: /usr/local/mni/Dec /Linux-i686/bin/nu_estimate_np_and_em -parzen -log -sharpen iterations 100 -stop shrink 4 -auto_mask -nonotify -b_spline 1 -distance 200 -quiet -execute -clobber -nokeeptmp -tmpdir /gpfs5/jinju/civet/nu_correct/ /gpfs5/jinju/civet/jj_t1.mnc /gpfs5/jinju/civet/jj_t1_nuc.imp (intensity mapping) Fitting splines: Number of iterations: 100 CV of field change: [ :41:55] running: ( omit the process of nu_evaluate) /usr/local/mni/Dec /Linux-i686/bin/make_template -quiet -shrink 3 /gpfs5/jinju/civet/jj_t1.mnc /usr/tmp/nu_correct //template.mnc ( nu_evaluate -> make_template : mapping <nu_field.imp> specify an intensity mapping => template.mnc)
7
mv -f /gpfs5/jinju/civet/jj_t1_nuc.mnc /tmp/nuc_inorm_stage-Lptt6d/nuc.mnc
minc_modify_header -sinsert :history="" /tmp/nuc_inorm_stage-Lptt6d/nuc.mnc rm -f /gpfs5/jinju/civet/jj_t1_nuc.imp minccalc -clobber -expression if(A[0]<0){out=0;}else{if(A[0]> ){out= ;}else{out=A[0];}} /tmp/nuc_inorm_stage-Lptt6d/nuc.mnc /gpfs5/jinju/civet/jj_t1_nuc.mnc
8
Distance : 200
9
Distance : 25
10
2. skull_masking_native
모듈: Linear_Transform.pm Label: "masking of skull in native space" 실행명령: progs/remove_skull bin/mincbet bin/dilate_volume bin/mincdefrag bin/minccalc bin/mincresample 입력: output/../native/mni_00100_{t1}_nuc.mnc 출력: output/../mask/mni_00100_skull_mask_native.mnc 의존성: nuc_t1_native
11
Stage: skull_masking_native
# Compute a preliminary skull mask for t1, t2, pd native, to # apply during linear registration. ${$pipeline_ref}->addStage( { name => "skull_masking_native", label => "masking of skull in native space", inputs => outputs => [$skull_mask], args => ["remove_skull", $maskType, $t1_input, $t2_input, $pd_input, $t2pd_t1_xfm, $skull_mask ], prereqs => $Coregister_complete }); [cf $t2_input, $pd_input, $t2pd_t1_xfm =>dummy, masktype=t1 ]
12
remove_skull (stage 2) # This step eliminates the skull and meninges using mincbet. For better performance by mincbet, use uniform steps for (x,y,z). Also, resample in the # same way as the original t1 image (the mincbet mask is z-y-x so if the original image is different, do a mincresample in order to be able to apply # the mask to its image). # mask non-cortical tissues using mincbet # run FSL bet on the classified t1 image (output is "${bet_prefix}_mask.mnc") # (Use -h switch only for t1.) my $bet_t1_mask = "${bet_prefix}_t1_mask.mnc"; &run( $mincbet, $t1_input, "${bet_prefix}_t1", "-n", "-m", "-h", "1.15", "-f", "0.50" ); &run( "mv", "-f", $bet_t1_mask, $bet_mask ); # fill up holes when mincbet fails (rare case of inverted surface). my $bet_filled = "${bet_prefix}_filled.mnc"; &run( "dilate_volume", $bet_mask, $bet_filled, 1, 6, 1 ); &run( "mincdefrag", $bet_filled, $bet_filled, 0, 6 ); &run( "dilate_volume", $bet_filled, $bet_filled, 0, 6, 2 ); &run( "minccalc", "-clobber", "-expression", "if(A[0]+A[1]>0.5){out=1;}else{out=0;}", $bet_mask, $bet_filled, $bet_mask_temp ); # getting mincbet data in correct form -like $t1_input. This also # applies when we have t2 and pd since the latter are coregistered # to t1. &run( "mincresample", "-clobber", "-byte", "-nearest_neighbour", "-like", $t1_input, $bet_mask_temp, $skull_mask );
13
self-intersection total = 2930572456.764605 (threshold=1000.000000)
remove_skull.log mincbet /gpfs5/jinju/civet/jj_t1_nuc.mnc /usr/tmp/remove_skull_31452//bet_t1 -n -m -h f 0.5 Reading Volume: hist_min= thresh2= thresh= thresh98= hist_max= THRESHOLD CofG ( , , ) mm RADIUS MEDIANVAL UPPER THRESHOLD self-intersection total = (threshold= ) thus will rerun with higher smoothness constraint CofG ( , , ) mm self-intersection total = (threshold= ) CofG ( , , ) mm self-intersection total = (threshold= ) CofG ( , , ) mm self-intersection total = (threshold= ) fractional threshold
14
mv -f /usr/tmp/remove_skull_31452//bet_t1_mask
mv -f /usr/tmp/remove_skull_31452//bet_t1_mask.mnc /usr/tmp/remove_skull_31452//bet_mask.mnc dilate_volume /usr/tmp/remove_skull_31452//bet_mask.mnc /usr/tmp/remove_skull_31452//bet_filled.mnc 1(dilation value) 6(neighbours) 1(n_dilation) ( 늘어난 voxel 의 수) mincdefrag /usr/tmp/remove_skull_31452//bet_filled.mnc /usr/tmp/remove_skull_31452//bet_filled.mnc 0 (label) 6(max-connect) Kept total of voxels of label 0 Removed total of 0 voxels of label 0 Outputting Volume: dilate_volume /usr/tmp/remove_skull_31452//bet_filled.mnc /usr/tmp/remove_skull_31452//bet_filled.mnc 0 (dilation value) 6 (neighbours) 2 (n_dilation) 274638 271907 minccalc -clobber -expression if(A[0]+A[1]>0.5){out=1;}else{out=0;} /usr/tmp/remove_skull_31452//bet_mask.mnc /usr/tmp/remove_skull_31452//bet_filled.mnc /usr/tmp/remove_skull_31452//bet_mask_temp.mnc mincresample -clobber -byte -nearest_neighbour -like /gpfs5/jinju/civet/jj_t1_nuc.mnc /usr/tmp/remove_skull_31452//bet_mask_temp.mnc /gpfs5/jinju/civet/skull_mask_native.mnc Elapsed time in remove_skull (31452) and children: sec (user) sec (system) = sec (total) mincdefrage –h input.mnc ouput.mnc label stencil[max_connect] label = integer label for voxel intensity stencil = number of neighbours(6,19,27) max_connect= threshold for number of connected voxels
15
=mincbet option –f <fractional threshold>
Imax is used to create tl, a locally appropriate intensity threshold that distinguishes between brain and background: It lies a preset fraction of the way between the global robust low intensity threshold t2 and the local maximum intensity Imax, according to fractional constant bt. This preset constant is the main parameter that BET can take as input. The default value of 0.5 has been found to give excellent results for most input images. =mincbet option –f <fractional threshold> : fractional intensity threshold (range 0~1) ;default=0.5 Smaller values give larger brain outline estimates because intensity threshold t1 is t2 (intensity threshold min) Larger values give smaller brain outline estimates because intensity threshold t1 is Imax (intensity threshold max ) Reference. Fast Robust Automated Brain Extraction (Stephen M. Smith*) HBM2002
16
f (fractional threshold):0.5 (default)
17
f (fractional threshold):0.2
Threshold =I min
18
f (fractional threshold):0.8
Threshold = Imax
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.