From f522cf993e2ddf64eb88c26bd5f994e41b174b47 Mon Sep 17 00:00:00 2001 From: "Kouichi C. Nakamura" Date: Fri, 4 Aug 2023 17:40:17 +0100 Subject: [PATCH] bug fix https://github.com/cortex-lab/allenCCF/issues/70 --- Browsing Functions/AtlasTransformBrowser.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Browsing Functions/AtlasTransformBrowser.m b/Browsing Functions/AtlasTransformBrowser.m index af86a1d..78cd002 100644 --- a/Browsing Functions/AtlasTransformBrowser.m +++ b/Browsing Functions/AtlasTransformBrowser.m @@ -779,8 +779,9 @@ function hotkeyFcn(f, slice_figure, keydata, allData, save_location, save_suffix disp('atlas location saved') % save transformed histology image - current_slice_image = imread(fullfile(save_location, [slice_name '.tif'])); -% current_slice_image = flip(get(ud_slice.im, 'CData'),1); + % current_slice_image = imread(fullfile(save_location, [slice_name '.tif']));%TODO no imreisze() used, size mismatch creates a huge error in transform + current_slice_image = flip(get(ud_slice.im, 'CData'),1); + R = imref2d(size(ud.ref)); curr_slice_trans = imwarp(current_slice_image, ud.transform, 'OutputView',R); imwrite(curr_slice_trans, fullfile(folder_transformations, [slice_name '_transformed.tif']))