# Create the SPECT segmentation using fwhm method and gradientweight function (Matlab)

**URL:** <https://discourse.slicer.org/t/create-the-spect-segmentation-using-fwhm-method-and-gradientweight-function-matlab/18936>\
**Category:** Development\
**Tags:** build, segmentation, extensions-manager, dicom\
**Created:** [July 27, 2021, 2:56am UTC](https://discourse.slicer.org/t/create-the-spect-segmentation-using-fwhm-method-and-gradientweight-function-matlab/18936 "2021-07-27T02:56:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![akmal871026](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/akmal871026/32/11642_2.png) [@akmal871026](https://discourse.slicer.org/u/akmal871026)\
**Post date:** [July 27, 2021, 2:56am UTC](https://discourse.slicer.org/t/create-the-spect-segmentation-using-fwhm-method-and-gradientweight-function-matlab/18936/1 "2021-07-27T02:56:04Z")

</div>

Hi all,

Anyone can help me to develop one method for SPECT segmentation?

First, we have to find the distance boundary of the volume using fwhm method.

Second, we use gradientweight function (Matlab) to calculate the VOI of the volume?

Anyone can help me?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [August 3, 2021, 5:53pm UTC](https://discourse.slicer.org/t/create-the-spect-segmentation-using-fwhm-method-and-gradientweight-function-matlab/18936/2 "2021-08-03T17:53:42Z")

</div>

You can implement a small Python script that measures these volumes fully automatically (or from manually specified seed points).

You can find examples in the script repository for [accessing voxels of a volume](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-value-of-a-volume-at-specific-voxel-coordinates), [compute histogram of a segmented region](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#get-histogram-of-a-segmented-region), etc.

You can get the image gradient by using [vtkImageGradient VTK filter](https://vtk.org/doc/nightly/html/classvtkImageGradient.html).

Let us know if you have any specific questions (how to get some data, how to compute something, etc.).
