overlay result images to check regional overlap among different analyses

Dear experts,

I have finished running the Reho and fALFF in DPARSF. The brain regions that have significant group differences (patients vs healthy controls) seem overlap between Reho and fALFF. I would like to take a closer look at these results, but slice viewer can only have one overlay at a time. Is there any way/script that would help to overlay more than one statistical images on top of each other in Rest or Brainnet viewer?

thank you very much!


Re: overlay result images to check regional overlap among ...

Hi, Jie, the multi-overlays function is easy to be added, the key is here (please change according to your version):


2440 function Result =AddOverlay(AType, AConfig, ATrueColorUnderlay)    
2441     switch lower(AType)
2442     case 'sagittal',
2443         AUnderlayPosition =AConfig.LastPosition(1);
2444     case 'coronal',        
2445         AUnderlayPosition =AConfig.LastPosition(2);
2446     case 'transverse',
2447         AUnderlayPosition =AConfig.LastPosition(3);
2448     otherwise
2449     end
2451     Result =ATrueColorUnderlay;
2452     if isempty(AConfig.Overlay.Filename),        
2453         return;
2454     else    %Add Overlay Image
2455         theOverlay =GetOverlayImg(AType, AConfig, AUnderlayPosition);
2457         %Resize image to the same size with the Anatomical image
2458         if license('test','image_toolbox')==1,
2459             if rest_misc('GetMatlabVersion')>=7.4   %YAN Chao-Gan 090401: The imresize function has been completely rewritten in Matlab R2007a. Fixed the bug of 'Set Overlay's Color bar' in Matlab R2007a or latter version.
2460                 theOverlay =imresize_old(theOverlay, [size(ATrueColorUnderlay, 1), size(ATrueColorUnderlay, 2)]);
2461             else
2462                 theOverlay =imresize(theOverlay, [size(ATrueColorUnderlay, 1), size(ATrueColorUnderlay, 2)]);
2463             end
2464         else,
2465             error('You must install image_toolbox first!');
2466         end
2468         nonZeroPos = theOverlay~=0;
2469         theOverlay =ScaleOverlay2TrueColor(AConfig, theOverlay, AConfig.Overlay.Colormap);
2470         %Add r g b colors with mask
2471         Result =AddRGBInMask(theOverlay, ATrueColorUnderlay, nonZeroPos, AConfig.Overlay.Opacity);
2472         %Result =theOverlay *AConfig.Overlay.Opacity + ATrueColorUnderlay*(1-AConfig.Overlay.Opacity);
2473     end

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.