Presentation is loading. Please wait.

Presentation is loading. Please wait.

[Stage 19: artefact] [Stage 20: extraction of the white matter mask for the hemispheres.

Similar presentations


Presentation on theme: "[Stage 19: artefact] [Stage 20: extraction of the white matter mask for the hemispheres."— Presentation transcript:

1 [Stage 19: artefact] [Stage 20: extraction of the white matter mask for the hemispheres.

2 1. nuc_t1_native 2. skull_masking_native 3. stx_register 4. stx_tal_to_7 5. stx_tal_to_6 6. tal_t1 7. nuc_inorm_t1 8. skull_removal 9. nlfit 10. mask_classify 11. pve_curvature 12. pve 13. reclassify 14. segment 15. cls_volumes 16. cortical_masking 17. segment_volumes 18. surface_classify 19. artefact 20. create_wm_hemispheres 21. segment_mask 22. expand_from_white_left 23. expand_from_white_right 24. slide_left_hemi_obj_back 25. flip_right_hemi_obj_back 26. slide_right_hemi_obj_back 27. calibrate_left_white 28. calibrate_right_white 29. laplace_field 30. gray_surface_left 31. gray_surface_right 32. mid_surface_left 33. mid_surface_right 34. surface_fit_error 35. verify_image_nlfit 36. gyrification_index_left 37. verify_brain_mask 38. classify_qc 39. dataterm_left_surface 40. brain_mask_qc 41. gyrification_index_right 42. dataterm_right_surface 43. surface_registration_left 44. surface_registration_right 45. mean_curvature_20mm_left 46. mean_curvature_20mm_right 47. thickness_tlink_20mm_right 48. thickness_tlink_20mm_left 49. resample_left_mean_curvature 50. resample_right_mean_curvature 51. resample_right_thickness 52. resample_left_thickness 53. lobe_area_right 54. lobe_area_left 55. verify_clasp 56. verify_image

3  모듈 : Artefact.pm  Label : “susceptability artefacts” Usage command line ◦ /progs/ artefact  bin/mincstats  bin/minccalc  bin/mincblur  Input : (1) mni_icbm_00100_brain_mask.mnc (2) mni_icbm_00100_t1_final.mnc  Output : mni_icbm_00100_artefact.mnc  의존성 : cortical masking

4  [args] ◦ name => "artefact", label => "susceptability artefacts", inputs => [$skull_mask, $t1_input], outputs => [$cls_artefact], args => ["class_art", "0.15", "4", $skull_mask, $t1_input, $cls_artefact], prereqs => $Prereqs});  [command line] ◦ /usr/local/mni/Dec-18-2008/CIVET- 1.1.9/progs/class_art 0.15 4 mni_icbm_00100_brain_mask.mnc./mni_icbm_00100_t 1_final.mnc./mni_icbm_00100_artefact.mnc

5  mni_icbm_00100_t1_final.mnc & mni_icbm_00100_artefact.mnc

6  (1) mincstats -mask./mni_icbm_00100_brain_mask.mnc -mask_binvalue 1 -mean./mni_icbm_00100_t1_final.mnc [Usage] : mincstats [options] [options] -mask: Use mask file for calculations. [Voxel selection options] -mask_binvalue: Include mask voxels within 0.5 of this value (list) -mean: mean value [Statistics] >> “mincstats” result -> Mean: 341720.7052  (2) minccalc -clobber -expression 'if(A[0]>0&&A[0]<51258.10578){out=1;}else{out=0;}' mni_icbm_00100_t1_final.mnc artefact_test.mnc mean value * 0.15( threshold value) = intensity_threshold >> 341720.7052 * 0.15 = 341720.7052 * (0+0.15) = 51258.10578  (3) mincblur -clobber -fwhm 4 artefact_test.mnc artefact_blur.mnc

7  mni_icbm_00100_t1_final.mnc & artefact_test.mnc

8  artefact_test.mnc & artefact_blur.mnc

9  모듈 : Surface_Fit.pm  Label : “create white matter hemispheric masks ”  Usage command line ◦ progs/extract_wm_hemisphere(s)  bin/minccalc  bin/mincresample  bin/mincdefrag  bin/dilate_volume  bin/mincblur  bin/mincstats  Input : (1) final_classify.mnc (2) mni_icbm_00100_t1_final.mnc (3)mni_icbm_00100_brain_mask.mnc (4) mni_icbm_00100_t1_nuc_mask_mask.mnc (5) mni_icbm_00100_t1_tal.xfm (6) /usr/local/mni/Dec-18-2008/CIVET- 1.1.9/models/  Output : (1) wm_left_centered.mnc (2) wm_right_centered.mnc  의존성 : Surface_classify

10  extract_wm_hemispheres extracts the white matter left and right hemispheres for the extraction of the white surfaces.  [argument] ${$pipeline_ref}->addStage( { name => "create_wm_hemispheres", label => "create white matter hemispheric masks", inputs => [$final_classify, $t1_tal_mnc, $brain_mask, $t1_tal_xfm], outputs => [$wm_left_centered, $wm_right_centered], args=>["extract_wm_hemispheres", $final_classify, $t1_tal_mnc, $brain_mask, $user_mask, $t1_tal_xfm, $Second_model_Dir, $wm_left_centered, $wm_right_centered], prereqs =>["surface_classify"] } );  [Command]  /usr/local/mni/Dec-18-2008/CIVET- 1.1.9/progs/extract_wm_hemispheres./final_classify.mnc./mni_icbm_00100_t1_fin al.mnc./mni_icbm_00100_brain_mask.mnc./mni_icbm_00100_t1_nuc_mask_mask. mnc../../transforms/linear/mni_icbm_00100_t1_tal.xfm /usr/local/mni/Dec-18- 2008/CIVET-1.1.9/models/./wm_left_centered.mnc./wm_right_centered.mnc

11  [output : wm_left & wm_right ]

12  [extract_wm_hemisphere]  [1] create a white matter mask from the current brain_mask  [2] apply brain mask to classified image  [3] create left and right masks for hemispheres (this works with any template, assuming the centerline voxel is at x=0).  [4] retain only white matter in left and right hemispheres.  [5] remove loose bits of disconnected white matter.  [6] put back removed bits of white matter in one hemisphere to the other one.  [7] center the masks.  [8] mirror the right mask to look like a left hemi.  [9] final removal of disconnected bits of white matter in each hemisphere.

13  create a white matter mask  (1) consider only 5mm around the perimeter of current brain mask (well, that's 5 layers of voxels, not 5mm).  [Command] dilate_volume mni_icbm_00100_brain_mask.mnc mask_eroded.mnc 0 6 5  [Usage]: dilate_volume input.mnc output.mnc dilation_value [6|26] [n_dilations] [mask.mnc min_mask max_mask] Dilates all regions of value dilation_value, by n_dilations of 3X3X3, (1 dilation by default). You can specify 6 or 26 neighbours, default being 26. If the mask volume and range is specified, then only voxels in the specified mask range will be dilated.  ** result ** 82514 80435 78028 75388 72578

14  [mni_icbm_00100_brain_mask.mnc & mask_eroded.mnc ]

15  create a white matter mask (2)  [Command] (2) minccalc -clobber -expression 'if(A[1]>0.5){out=A[0];}else{out=0;}' final_classify.mnc mask_eroded.mnc cls_eroded.mnc

16  create a white matter mask  compute t1 mean and variance of classified white matter inside the eroded brain mask (avoid high intensity voxels of skull).  [Command]  (3) mincstats -quiet -mask cls_eroded.mnc -mask_binvalue 3 -mean mni_icbm_00100_t1_final.mnc  >> **result ** 400878.6084 >> white_mean  (4) mincstats -quiet -mask cls_eroded.mnc -mask_binvalue 3 -std mni_icbm_00100_t1_final.mnc  >> **result ** 49100.7272 >> white_std  >  white_threshold = white_mean + 2.0 * white_std = 400878.6084 + 2.0 * 49100.7272  **result** >> white_treshold : 499,080.0628

17  create a white matter mask  mask out the t1 high intensity voxels in the eroded region of the brain mask. Keep only those classified white voxels to remove. (5) minccalc -clobber -expression 'if(A[0]>2.5&&A[2] 0.5&&A[1]>499080.0628){out=10;}else{out=0;}' final_classify.mnc./mni_icbm_00100_t1_final.mnc./mask_eroded.mnc./mni_icbm_0010 0_brain_mask.mnc./cls_eroded_5.mnc

18  create a white matter mask  blur the bright voxels to remove to diffuse effect to immediate neighbours  (6) mincblur -clobber -fwhm 2 cls_eroded_5.mnc cls_eroded_5

19  create a white matter mask  remove the bright voxels and their immediate neighbours.  (7) minccalc -clobber -byte -expression 'if(A[0]>2.5&&A[2]>1.5){out=1;}else{if(A[1]>0.5){out=A[0];}else{out=0;}}'./final_classify.m nc./mni_icbm_00100_brain_mask.mnc./cls_eroded_5_blur.mnc./white_mask.mnc

20  create a white matter mask  remove loose bits of white matter.  (8) mincdefrag./white_mask.mnc./white_mask_defrag.mnc 3 6  **result ** Kept total of 671600 voxels of label 3, Removed total of 546 voxels of label 3

21  create a white matter mask  blur the masked classified image.  (9) mincblur -clobber -fwhm 5 white_mask_defrag.mnc white_mask_defrag

22  create a white matter mask  threshold at 1.5 (csf-gm border) to obtain the final white matter mask.  (10) minccalc -clobber -byte -expression 'if(A[0]>1.5||A[1]>0.5){out=1;}else{out=0;}' white_mask_defrag_blur.mnc mask_eroded.mnc wm_mask_1_final.mnc

23  (2) apply brain mask to classified image minccalc -clobber -expr 'if(A[1]>0.5){out=A[0];}else{out=0;}'./final_classify.mnc./wm_mask_1_final.mnc./classify_masked.mnc

24  (3) -1 create left and right masks for hemispheres (this works with any template, assuming the centerline voxel is at x=0). minccalc -clobber -byte -expression 'out=1'./final_classify.mnc final_classify_fill.mnc  [3-1-1] mincinfo -dimlength xspace final_classify.mnc  [Usage] : mincinfo [ ] [...]  -dimlength: Print the length of the specified dimension.  ** result ** >> 181 -> ‘ xlen’ is ( result +1) /2 >> ‘xlen’ is “91”

25  Usage: mincresample [ ] ◦ -like: Specifies a model file for the resampling. ◦ -xnelements: Number of elements along the X dimension ◦ -xstart: Start point along the X dimension  Default value: 1.79769e+308  Mincresample will resample a minc file along new spatial dimensions with new voxel positions. Eac h volume in the input file (given by the spatial di mensions xspace, yspace and zspace) is resampl ed according to the command-line options.

26  (3)-2 mincresample -clobber -xnelements 91./final_classify_fill.mnc./hemi_tmp.mnc  (3)-3 mincresample -clobber -like final_classify.mnc hemi_tmp.mnc hemi_left_temp.mnc

27  (3)-4 mincresample -clobber -xstart 0 -xnelements 91 final_classify_fill.mnc hemi_temp_1.mnc  (3)-5 mincresample -clobber -like final_classify.mnc./hemi_temp_1.mnc./hemi_right_mask.mnc

28  (4) retain only white matter in left and right hemispheres.  (4)-1 [command] minccalc -clobber -byte -expr 'out=(abs(A[0]-3)<0.45)&&A[1];' classify_masked.mnc hemi_left_temp.mnc./wm_crop_left.mnc

29  (4) retain only white matter in left and right hemispheres.  (4)-2 [command] minccalc -clobber -byte -expr 'out=(abs(A[0]-3)<0.45)&&A[1];'./classify_masked.mnc./hemi_right_mask.mnc./wm_crop_right.mnc

30  (5) remove loose bits of disconnected white matter.  (5)-1[command] mincdefrag./wm_crop_left.mnc./wm_defrag_left.mnc 1 27 100000  **result ** : Kept total of 333448 voxels of label 1, Removed total of 0 voxels of label 1  (5)-2 [command] mincdefrag./wm_crop_right.mnc./wm_defrag_right.mnc 1 27 100000  **result ** : Kept total of 338355 voxels of label 1, Removed total of 1 voxels of label 1

31  (6) put back removed bits of white matter in one hemisphere to the other one.  (6)-1 [command] minccalc -clobber -byte -expr 'out=A[0]||(A[1]&&!A[2]);'./wm_defrag_left.mnc./wm_crop_right.mnc./wm_defrag_right.mnc./wm_add_back_left.mnc  (6)-2 [command] minccalc -clobber -byte -expr 'out=A[0]||(A[1]&&!A[2]);' ./wm_defrag_right.mnc./wm_crop_left.mnc./wm_defrag_left.mnc./wm_add_back_right.mnc

32  (7) center the masks.  (7)-1 [command] mincresample -clobber -like./wm_add_back_left.mnc -transform /usr/local/mni/Dec-18-2008/CIVET-1.1.9/models/slide_right.xfm./wm_add_back_left.mnc./mni_icbm_00100_wm_left_centered.mnc  (7)-2 [command] mincresample -clobber -like./wm_add_back_right.mnc -transform /usr/local/mni/Dec-18-2008/CIVET-1.1.9/models/slide_left.xfm./wm_add_back_right.mnc./mni_icbm_00100_wm_right_centered.mnc

33  [slide_left.xfm] ◦ MNI Transform File Transform_Type = Linear; Linear_Transform = 1 0 0 -30 0 1 0 0 0 0 1 0;  [slide_right.xfm] ◦ MNI Transform File Transform_Type = Linear; Linear_Transform = 1 0 0 30 0 1 0 0 0 0 1 0;

34  (8) mirror the right mask to look like a left hemi.  mincresample -clobber -like./wm_right_centered.mnc -transform /usr/local/mni/Dec-18- 2008/CIVET-1.1.9/models/flip_right.xfm./wm_right_centered.mnc./wm_right_centered_9.mnc

35  flip_right.xfm  MNI Transform File  Transform_Type = Linear;  Linear_Transform =  -1 0 0 0  0 1 0 0  0 0 1 0;

36  (9) final removal of disconnected bits of white matter in each hemisphere. (9)-1 : mincdefrag wm_left_centered.mnc./wm_left_centered_final.mnc 1 6 1000000 ** result ** : Kept total of 333222 voxels of label 1, Removed total of 0 voxels of label 1  (9)-2 : mincdefrag./wm_right_centered_9.mnc./wm_right_centered_final.mnc 1 6 100000  ** result ** : Kept total of 338128 voxels of label 1, Removed total of 0 voxels of label 1


Download ppt "[Stage 19: artefact] [Stage 20: extraction of the white matter mask for the hemispheres."

Similar presentations


Ads by Google