【问题标题】:Image registration in imageJ or matlabimageJ 或 matlab 中的图像配准
【发布时间】:2014-09-19 20:56:35
【问题描述】:

我正在寻找有关如何自动注册以不同放大倍率获取的图像堆栈的建议。特别是,我们需要将活脑中几个脑细胞的小 z-stack (~100um) 与固定大脑中的大 z-stack(~2mm) 对齐。我们希望能够找回之前成像的细胞,并拍摄高分辨率的染色图像来识别突触前输入。需要考虑放大倍率和旋转的差异以及可能的收缩或膨胀。我们希望获得有关使用 ImageJ 或 matlab 执行此操作的最佳方法的建议。

【问题讨论】:

    标签: matlab imagej


    【解决方案1】:

    使用 ImageJ,您可能需要下载插件 StackReg:

    http://bigwww.epfl.ch/thevenaz/stackreg/

    或者这个漂亮的宏代码免费提供:

    http://www.plosone.org/article/info%3Adoi%2F10.1371%2Fjournal.pone.0053942

    使用 matlab,您正在寻找 imregister、imregtform 和/或 imwarp。另请查看优化器,它用于定义您希望应用的转换类型,例如平移、刚体等。matlab 网站上的示例非常有帮助。如果不清楚,请询问更多详细信息。

    编辑:

    这是一个简单的代码,用于使用 Matlab 和我提到的函数来注册存储在单元数组中的序列中的图像:

    clear 
    clc
    
    
    dialog_title = 'Select the directory containing the images to be processed'; % select images
    folder_name = uigetdir('',dialog_title);
    
    addpath(folder_name);
    
    % select current folder
    cd(folder_name);
    
    ImagesToRead = dir('*.tif');
    
    %preallocation
    
    ImageCell = cell(1,length(ImagesToRead));
    
    for i=1 : length(ImagesToRead)    
       ImageCell{i} = imread(ImagesToRead(i).name);    
    end
    
    
    optimizer = registration.optimizer.RegularStepGradientDescent; % here you can modify the default properties of the optimizer to suit your need/to adjust the parameters of registration.
    
    [optimizer, metric]  = imregconfig('monomodal'); % for optical microscopy you need the 'monomodal' configuration.
    
    RegisteredCell = cell(1,length(ImagesToRead));
    for p = 2:length(ImagesToRead)
    
       moving = ImageCell{p}; % the image you want to register
       fixed = ImageCell{p-1}; % the image you are registering with
    
       movingONE = rgb2gray(moving(:,:,:)); % imregtform needs grayscale images
       fixedONE = rgb2gray(fixed(:,:,:));
    
       tform = imregtform(movingONE,fixedONE,'translation',optimizer,metric,'DisplayOptimization',true,'PyramidLevels',5);                   
       tform = affine2d(tform.T);
    
       RegisteredCell{p} = imwarp(moving,tform,'OutputView',imref2d(size(fixedONE))); % 
    
    end
    

    现在您的所有图像都存储在单元格数组“RegisteredCell”中,您可以使用 RegisteredCell{YouImage} 单独访问每个图像。希望对您有所帮助!

    【讨论】:

    • @user3884830 你有机会尝试一下吗?
    猜你喜欢
    • 2023-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-09
    • 2014-09-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多