averaging ROIs
averaging ROIs
Hello,
Appologies in advance for this basic question. I want to make a mean image of several ROIs that I have labelled using anatomist (*ima files). These ROIs do overlap (I checked this by fusing them), and are binary. I used 'AimsAverage -i *ima -o mean.ima', but the output image is also a binary image, and does not look like the average of the input ones. What am I doing wrong?
thanks,
Narly.
Appologies in advance for this basic question. I want to make a mean image of several ROIs that I have labelled using anatomist (*ima files). These ROIs do overlap (I checked this by fusing them), and are binary. I used 'AimsAverage -i *ima -o mean.ima', but the output image is also a binary image, and does not look like the average of the input ones. What am I doing wrong?
thanks,
Narly.
====================================
Narly Golestani
University of Geneva
& University College London
====================================
Narly Golestani
University of Geneva
& University College London
====================================
Hi ,
It seems logic
You can obtain the grey levels of the image which correspond to the mask by using AimsMask.
So after the mask drawing and before AimsAverage, use AimsMask to preserve the grey levels.
Isa
It seems logic
You can obtain the grey levels of the image which correspond to the mask by using AimsMask.
Code: Select all
AimsMask -i initial_data.ima -m mask_binary.ima -o data_to_sum.ima
Isa
Hi Isa,
I want to simply average the binary files in order to have the 'probabilistic map' of this particular structure. I don't think that what you described does this - I don't want to use the mask to obtain the original T1 signal intensities witihin the mask. This is why I appologised for the simplicity of the question
thanks in advance for your help,
Narly.
I want to simply average the binary files in order to have the 'probabilistic map' of this particular structure. I don't think that what you described does this - I don't want to use the mask to obtain the original T1 signal intensities witihin the mask. This is why I appologised for the simplicity of the question
thanks in advance for your help,
Narly.
====================================
Narly Golestani
University of Geneva
& University College London
====================================
Narly Golestani
University of Geneva
& University College London
====================================
Ok, here is a documentation extract for the next aims tutorial :
Hope that helps.
Isa
Code: Select all
AimsLinearComb: sum 2 activation maps
OPTIONS:
AimsLinearComb: linear combination a.I1/b + c.I2/d + e. Note : a, b, c, d, and e must be real.
------------------------------------------------------------------
AimsLinearComb -i <i1> [-a <num1>] [-b <den1>]
[-j <i2> [-c <num2>] [-d <den2>]]
[-e <cst>]
-o[utput] <fileout>
[-t[ype] <datatype>
[-h[elp]]
------------------------------------------------------------------
Linear combination a.I1/b + c.I2/d + e
Note : a,b,c,d,e must be real
------------------------------------------------------------------
i1 : first data (volume or texture)
num1 : multiplicative coefficient for the first data [1.0]
den1 : divisor coefficient for the first data [1.0]
i2 : second data (volume or texture)
(if none, linear combination a.I1/b)
num2 : multiplicative coefficient for the second data[1.0]
den2 : divisor coefficient for the second data [1.0]
cst : constant offset value [default=0.0]
fileout : destination data
datatype: data type of the destination volume/texture (S16, U8, ...)
[default=type of in1]
For texture, i1, i2 and fileout must have the same type
------------------------------------------------------------------
EXAMPLE: Sum of 2 activation maps. For instance, if you have 2 binary activation maps which have been obtained by functional analysis, and if you want to do a fusion of both, then you can create a new volume which will be the sum of map_I and map_II.
prompt% AimsLinearComb -i map_I.img -j map_II.img -o map_I+II.img
options parsed
i1 : map_I.img
a : 1
b : 1
c : 1
d : 1
e : 0
i2 : map_II.img
fileout : map_I+II.img
type :
Reading image map_I.img...
done
reading image map_II.img...
done
processing...
done
writing result...
done
NOTE: image dimensions must be the same.
NOTE: you can use this command line to add several volumes; first add up map_I and map_II to create map_I+II and if you have a third volume, map_III to fusion with map_I and map_II, then you can use AimsLinearComb with map_I+II and map_III.
Hope that helps.
Isa
- riviere
- Site Admin
- Posts: 1361
- Joined: Tue Jan 06, 2004 12:21 pm
- Location: CEA NeuroSpin, Saint Aubin, France
- Contact:
Hi,
I guess your problem with AimsAverage was due to the integer output data type: if your input images only contain values 0 (background) and 1 (ROI), the average values should be floating point values (0.5 for instance). But if you write int16 data, the values will be truncated (so you will get 0). Try with the -t FLOAT option to force a floating point output image.
AimsLinearComb will also work, but it only accepts 2 input images, so if you have 3 or more, you will need to call it several times, so AimsAverage should be more convenient in your case.
Denis
I guess your problem with AimsAverage was due to the integer output data type: if your input images only contain values 0 (background) and 1 (ROI), the average values should be floating point values (0.5 for instance). But if you write int16 data, the values will be truncated (so you will get 0). Try with the -t FLOAT option to force a floating point output image.
AimsLinearComb will also work, but it only accepts 2 input images, so if you have 3 or more, you will need to call it several times, so AimsAverage should be more convenient in your case.
Denis