Back to the main page.

Bug 2080 - without any warning/message ft_volumesegment throws away csf, white and gray when cfg.output also contains brain

Status CLOSED FIXED
Reported 2013-03-26 16:21:00 +0100
Modified 2018-03-10 21:39:13 +0100
Product: FieldTrip
Component: core
Version: unspecified
Hardware: PC
Operating System: Windows
Importance: P3 normal
Assigned to: Lilla Magyari
URL:
Tags:
Depends on:
Blocks:
See also:

Jörn M. Horschig - 2013-03-26 16:21:24 +0100

when the user desires ambiguous output parameter, either an error or a warning about the decision of the algorithm should be thrown (brain is defined as csf+white+gray) example: cfg = []; cfg.output = {'brain', 'skull','scalp', 'csf', 'gray', 'white'}; segmentedmri = ft_volumesegment(cfg, mris); the input is volume data with dimensions [256 256 256] performing the segmentation on the specified volume creating scalpmask smoothing anatomy with a 5-voxel FWHM kernel thresholding anatomy at a relative threshold of 0.100 creating brainmask smoothing brainmask with a 5-voxel FWHM kernel thresholding brainmask at a relative threshold of 0.500 creating skullmask K>> segmentedmri segmentedmri = dim: [256 256 256] transform: [4x4 double] coordsys: 'mni' unit: 'mm' brain: [256x256x256 logical] skull: [256x256x256 logical] scalp: [256x256x256 logical] cfg: [1x1 struct] K>>


Lilla Magyari - 2013-04-23 12:29:22 +0200

(In reply to comment #0) hi Jorn, yes, this is true. The reason is for this to avoid overlapping segmentations. If your binary masks overlap you will have problems in the subsequent computations (because it will be ambiguous to which tissue a voxel belongs to.) If you want to have a binary mask for brain and also for csf, white, and gray, skull and skin I suggest the following: cfg = []; cfg.output = {'csf', 'gray', 'white'}; tpm = ft_volumesegment(cfg, mris); This will give the probabilistic representation (not the binary mask!) of the csf, gray, white tissues. cfg = []; cfg.output = 'brain'; brain = ft_volumesegment(cfg, tpm); You will get the binary brain mask. cfg = []; cfg.output = {'skull','scalp', 'csf', 'gray', 'white'}; fivetissueseg = ft_volumesegment(cfg, tpm); You will get the binary mask for all other 5 tissues. I think this is the most efficient way to do, because all binary masks (except of skin) are based on the tissue probability mask (tpm) but that takes the longest time to compute. So, if you compute that first, you can use it as an input, and you will get faster your other two segmentations. Lilla


Lilla Magyari - 2013-04-23 14:51:22 +0200

I have added a few extra line in the documentation of ft_volumesegment: It is not possible to request tissue-probability map (tpm) in combination with binary masks (brain, scalp or skull) or skull-stripped anatomy. The output will return only the probabilistic maps in segment.gray, white and csf. However, when a segmentation with the probabilistic gray, white and csf representations is available, it is possible to use it as input for brain or skull binary mask. For example: cfg = []; cfg.output = {'tpm'}; segment_tpm = ft_volumesegment(cfg,mri); cfg.output = {'brain'}; segment_brain = ft_volumesegment(cfg,segment_tpm); And I ensured that when a segmentation is the input, it contains a probabilistic segmentation of the csf, white and gray matter (in contrast with a binary representation). (in line 234-238) And I will try to commit this now. Lilla


Lilla Magyari - 2013-04-25 09:51:22 +0200

changes have been committed