# Difference in sh2peaks and fod2peaks output. How to use -split command on fod2peaks output?

**URL:** https://community.mrtrix.org/t/difference-in-sh2peaks-and-fod2peaks-output-how-to-use-split-command-on-fod2peaks-output/1083
**Category:** Uncategorized
**Created:** [August 4, 2017, 11:52am UTC](https://community.mrtrix.org/t/difference-in-sh2peaks-and-fod2peaks-output-how-to-use-split-command-on-fod2peaks-output/1083 "2017-08-04T11:52:26Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Max\_Wichmann](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Max\_Wichmann](https://community.mrtrix.org/u/Max_Wichmann)
#### Post date: [August 4, 2017, 11:52am UTC](https://community.mrtrix.org/t/difference-in-sh2peaks-and-fod2peaks-output-how-to-use-split-command-on-fod2peaks-output/1083/1 "2017-08-04T11:52:26Z")

</div>

Hello Mrtrix Team,  
I would like to view just the first peak direction so that I have to separate my peak file in the 4th dimension in two 3 volumes.  
I prefer to calculate my peaks via fod2peaks but the output is not like the output from sh2peaks? Thus I can not split it. Actually I do not understand the peak dimension of the fod2peak output.

1. How do I get just the first peak image from the fod2peak output?

2. In addition I also get slightly different results when I compare the peaks results from fod2peak and sh2peak via mrview. Is this normal?

3. I was wondering if there is a possibility to get the phi/theta coordinates of the peak as output via a command option.

Thank you for your help!  
Best  
Max

---

<div class="post-metadata">

### Author: ![jdtournier](https://community.mrtrix.org/user_avatar/community.mrtrix.org/jdtournier/32/2594_2.png) [@jdtournier](https://community.mrtrix.org/u/jdtournier)
#### Post date: [August 4, 2017, 1:36pm UTC](https://community.mrtrix.org/t/difference-in-sh2peaks-and-fod2peaks-output-how-to-use-split-command-on-fod2peaks-output/1083/2 "2017-08-04T13:36:28Z")

</div>

There is no `fod2peak` command that I’m aware of… Do you mean `fod2fixel`…?

For `sh2peaks`, you can simply use the `-num 1` option to request the single largest peak. If you’ve already computed your peaks using `sh2peaks` and want to extract the largest one, then:

```auto
$ mrconvert peaks.mif -coord 3 0,1,2 first_peak.mif`

```

will do the trick (just extract the first 3 volumes).

Other than that:

1. Assuming your `fod2peaks` actually refers to `fod2fixel`, then the output of that command is in [fixel format](http://mrtrix.readthedocs.io/en/latest/getting_started/image_data.html#fixel-image-directory-formathttp://mrtrix.readthedocs.io/en/latest/getting_started/image_data.html#fixel-image-directory-format), which is quite a different beast. You can convert back to a ‘regular’ image using the `fixel2voxel` command. If you want the single largest direction, then I _think_ the correct call would be something like

2. Yes, this is normal: `sh2peaks` returns the actual peak of the FOD, while `fod2fixel` will provide the mean orientation of the peak, integrated over its solid angle. The idea is that this might be more robust to subtle asymmetries and other potential oddities in the FOD.

3. Unfortunately not, sorry…

---

<div class="post-metadata">

### Author: ![Max\_Wichmann](https://community.mrtrix.org/letter_avatar_proxy/v4/letter/m/ecd19e/32.png) [@Max\_Wichmann](https://community.mrtrix.org/u/Max_Wichmann)
#### Post date: [August 8, 2017, 10:44am UTC](https://community.mrtrix.org/t/difference-in-sh2peaks-and-fod2peaks-output-how-to-use-split-command-on-fod2peaks-output/1083/3 "2017-08-08T10:44:02Z")

</div>

Thank you for this detailed answer!  
Yes of course I mean the `fod2fixel` command.  
Thank you for all the help.  
Best  
Max

---

<div class="post-metadata">

### Author: ![rsmith](https://community.mrtrix.org/user_avatar/community.mrtrix.org/rsmith/32/2672_2.png) [@rsmith](https://community.mrtrix.org/u/rsmith)
#### Post date: [August 8, 2017, 11:58am UTC](https://community.mrtrix.org/t/difference-in-sh2peaks-and-fod2peaks-output-how-to-use-split-command-on-fod2peaks-output/1083/4 "2017-08-08T11:58:25Z")

</div>

> I would like to view just the first _peak direction_

For just the first peak _direction_ (as opposed to the _data value_ associated with the largest fixel in the voxel), you want: `fixel2voxel split_dir -number 1`.

> I was wondering if there is a possibility to get the phi/theta coordinates of the peak as output via a command option.

Not via a command-line option. But if you _really_ wanted to, you could split the x, y and z volumes into separate images, and do the cartesian → spherical conversion via `mrcalc` (all the trigonometric functions are there).
