# Extracting MD and FA after adding pathology image to 5tt

**URL:** <https://community.mrtrix.org/t/extracting-md-and-fa-after-adding-pathology-image-to-5tt/6427>\
**Category:** Uncategorized\
**Created:** [February 22, 2023, 6:10pm UTC](https://community.mrtrix.org/t/extracting-md-and-fa-after-adding-pathology-image-to-5tt/6427 "2023-02-22T18:10:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Caleb\_Haynes](https://community.mrtrix.org/user_avatar/community.mrtrix.org/caleb_haynes/32/4200_2.png) [@Caleb\_Haynes](https://community.mrtrix.org/u/Caleb_Haynes)\
**Post date:** [February 22, 2023, 6:10pm UTC](https://community.mrtrix.org/t/extracting-md-and-fa-after-adding-pathology-image-to-5tt/6427/1 "2023-02-22T18:10:13Z")

</div>

Hi there,

I’m currently trying to pull FA and MD metrics from a DWI image I ran through 5ttgen. Since I added a pathology image, I am unsure how to account for that. I registered my 5tt output to DWI space.

Before I added the pathology scan, I was able to do this by pulling the 5tt wm mask and converting to a tensor with

```auto
mrconvert -coord 3 2 5tt.mif wm_mask.nii.gz
dwi2mask dwi_denoised_unringed_preproc_unbiased.mif dwimask.nii.gz
dwi2tensor dwi_denoised_unringed_preproc_unbiased.mif tensor.nii.gz -mask dwimask.nii.gz

```

And then I pulled the metrics and wrote out to files via

```auto
tensor2metric tensor.nii.gz -fa wm_FA.nii.gz
tensor2metric tensor.nii.gz -adc wm_MD.nii.gz 
mrgrid wm_mask.nii.gz regrid -template wm_FA.nii.gz wm_mask_regrid.nii.gz
mrstats -ignorezero -output mean -mask wm_mask_regrid.nii.gz wm_FA.nii.gz >> FA.txt
mrstats -ignorezero -output mean -mask wm_mask_regrid.nii.gz wm_MD.nii.gz >> MD.txt

```

Would I have to do a subtraction of sorts from the wm mask by the path image before generating the tensor? Can I skip regridding since I have already registered to DWI space?

Thanks so much, please excuse my novice knowledge on the topic- I’m more used to working with fMRI!

Best,  
Caleb
