You need to define mapparameters first.

Then use:

Best Regards, Donald McLaren
D.G. McLaren, Ph.D.
Research Fellow, Department of Neurology, Massachusetts General Hospital and
Harvard Medical School
Postdoctoral Research Fellow, GRECC, Bedford VA
Office: (773) 406-2464
This e-mail contains CONFIDENTIAL INFORMATION which may contain PROTECTED
intended only for the use of the individual or entity named above. If the
reader of the e-mail is not the intended recipient or the employee or agent
responsible for delivering it to the intended recipient, you are hereby
notified that you are in possession of confidential and privileged
information. Any unauthorized use, disclosure, copying or the taking of any
action in reliance on the contents of this information is strictly
prohibited and may be unlawful. If you have received this e-mail
unintentionally, please immediately notify the sender via telephone at (773)
406-2464 or email.

On Wed, Dec 4, 2013 at 10:56 AM, M.Momenian <[log in to unmask]> wrote:
Dear Donald

Thanks for your kind reply. Your comments really helped me. I've got another problem related to peak_nii toolbox. I downloaded it and put it in the toolbox directory of my spm folder. I added the path in MATLAB as well. Peak_nii toolbox appears in the SPM 8 toolbox menu, but when I click it, the following message just pops out: Error using peak_nii (line 75)
Not enough input arguments.

Error in spm (line 965)
Error while evaluating uicontrol Callback

Where do you think I might have gone wrong? Thanks again for everything

Best wishes

On Wednesday, December 4, 2013 1:40 AM, "MCLAREN, Donald" <[log in to unmask]> wrote:

On Tue, Dec 3, 2013 at 2:55 PM, M.Momenian <[log in to unmask]> wrote:
Dear Donald

Thanks for the kind answer. I loaded the T-maps as the input file in imcalc. The result is an .img file with three colours in it when I display it: white, gray, and black. Which of these colours is the overlap area?

>> I'd assume white. The overlap will have a value of 3, voxels with a value of 1 are unique to the first contrast, while voxels values of 2 are are unique to the second contrast.
I'd like to report where the clusters overlap across the two groups. How should I load this image and report the overlap coordinates?

>> You can either use FIVE (functional image visualization environment) or the peak_nii toolbox to get the coordinates of the areas of overlap.

I highly appreciate your comments

best wishes

On Tuesday, December 3, 2013 7:47 PM, "MCLAREN, Donald" <[log in to unmask]> wrote:
An alternative approach:

Save the thresholded maps. Then use the following equation in imcalc:

This will show you where significant clusters are located for the 2 groups and where the clusters overlap.

On Mon, Dec 2, 2013 at 2:31 PM, Colin Hawco <[log in to unmask]> wrote:
Hah, SPM does so  many strange things!  

I don't have a script for this, but I can give you the code to use. You need to generate t-maps separately for each contrast. Then, lets call the first contrast FileA, and the second FileB. 

%masks file B with A, and output t-value from fileB, butonly for voxels overlapping with significant voxels in FileA. Note that an extent threshold is not applied. 
fileA = 'spmT_0001.img' %for example
fileB = 'spmT_0002.img' %for example again

data = spm_read_vols(v);

v2= spm_vol(fileB)
data2 = spm_read_vols(v2);
t_thresh = 3.5 %% significant t-stat threshold, change as needed
data2(data<=t_thresh) = 0;

 v2.fname = 'spmt_conjunction.img' %renames the output file
 spm_write_vol(v2, data2)
%% done

Now, here is a trick I think should work. If you load the SPM.mat file and rename the name of the T-map, it will then load this image into SPM results and you can get the activation tables, etc. 
SPM.xCon(1).Vspm.fname =  'spmt_conjunction.img'

i am not 100% sure if that will work. Alternately  if instead of changing v2.fname you leave it the same, SPM should load the conjunction map if you select the contrast from fileB. 

Let me know if you need a bit more help. 

On 2 December 2013 13:55, M.Momenian <[log in to unmask]> wrote:
Dear Colin

Thanks a lot for your kind reply. I ran the inclusive masking two times in the following order: once I inclusively masked A with B, and once B with A. The results were again different. They should be. You said inclusive masking is fit for "detecting things which are significant in both groups". I guess inclusive masking is putting all significant voxels from two contrasts together, rather than coming up with the ovarlap between the two contrasts. I am interested in the overlap in the two groups. I wonder if I can have your script written to detect the overlap as well. It would be so kind of you.

Best wishes

On Monday, December 2, 2013 9:58 PM, Colin Hawco <[log in to unmask]> wrote:
Hello Mohammed, 

I have never run a conjunction analysis in SPM, so I cannot directly address your issue. However, for what it is worth, I would prefer to use an inclusive masking approach, in which the results of one t-map are used to mask another, provided a masked conjunction of the results. I have used a similar approach in some of my work, but I wrote a script to find overlap rather than using SPM. This is a very valid form of conjunction analysis for detecting things which are significant in both groups. 

I also believe it is a very statistically robust approach to use inclusive masking, assuming the two analysis you are using are properly corrected for multiple comparisons. 

The reason your results are different between conjunction and masking is due to the nature of the "conjunction" analysis, which is a statistical approach. It attempts to find voxels where Beta A and Beta B are both not zero. However, it can potentially detect a conjunction in which the voxels from Beta B, while non-zero, do not survive statistical significance in an analysis of only Beta B. This may happen when Beta B is small and Beta A is very large. At least according to my admittedly limited understanding. 

So, my 2 cents, you can't go wrong using inclusive masking, a "masked conjunction". You know for sure that all voxels are significant in both contrasts. 


On 2 December 2013 11:49, M.Momenian <[log in to unmask]> wrote:
Dear SPMers

I just sent an email yesterday, but there was no answer. I know my question was simple. but I couldn't find a clear answer to the question. I read in SPM8 manual that if I want to see the effects which are common across the two groups in my study, I can either use inclusive masking or conjunction analysis. I did both of them, but the results are different. I also searched the list, but it did not soothe my confusion. I decided to write again and ask how I should solve this problem of mine. I want to see the brain activations which are common across my two groups in Task A. Then, I want to see these common areas in Task B across the two groups. Which method is more reliable? I highly appreciate your comments dear all.

Reading you soon