how to fuse 2 set data different length frame

5 views (last 30 days)
Hi all, i have 60 image SPECT, and 193 Image CT. how to fuse it? which different length frame/slice.
i use imfuse but failed.
anyone can help me?
clc
clear all
% Get a list of all files in the folder with the desired file name pattern.
myFolder = 'C:\Users\Akmal\Downloads\phantom IEC, weight 12.8 kg-20210104T080816Z-001\phantom IEC, weight = 12.8 kg\xQuant\xquant';
filePattern = fullfile(myFolder, '*.dcm'); % Change to whatever pattern you need.
theFiles = dir(filePattern);
for K = 1 : length(theFiles)
baseFileName = theFiles(K).name;
fullFileName = fullfile(theFiles(K).folder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
% Now do whatever you want with this file name,
% such as reading it in as an image array with imread()
N(:,:,K) = dicomread(fullFileName);
scale = 256/103 ;
Pi(:,:,K) = imresize(N(:,:,K),scale) ; % where P is your 103*103 3D matrix
end
% Get a list of all files in the folder with the desired file name pattern.
myFolder = 'C:\Users\Akmal\Downloads\phantom IEC, weight 12.8 kg-20210104T080816Z-001\phantom IEC, weight = 12.8 kg\xQuant\xquant\ct';
filePattern = fullfile(myFolder, '*.dcm'); % Change to whatever pattern you need.
theFiles = dir(filePattern);
for L = 1 : length(theFiles)
baseFileName = theFiles(L).name;
fullFileName = fullfile(theFiles(L).folder, baseFileName);
fprintf(1, 'Now reading %s\n', fullFileName);
% Now do whatever you want with this file name,
% such as reading it in as an image array with imread()
M(:,:,L) = dicomread(fullFileName);
end
imfuse2(Pi, M);

Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!