I am interested in automatic segmentation of different muscle types in the calf region using MATLAB. Please, are there any robust MATLAB toolbox for MRI Calf Muscle Segmentation?
this can help you
%analyze_series8.m
% Copyright 2004-2010 The MathWorks, Inc.
%start with clean slate (nobkpt)
clear %no variables
close all %no figures
clc %empty command window
%% Data Access
%----------------------------------------------------------------------
%DICOM support (nobkpt)
web([docroot '/toolbox/images/intro19.html'])
%filename convention used in image series (nobkpt)
prefix = 'Series 8\I0000';
fnum = 417:476;
ext = '_anon.dcm';
%first filename in series (nobkpt)
fname = [prefix num2str(fnum(1)) ext];
%examine file header (nobkpt)
info = dicominfo(fname)
%extract size info from metadata (nobkpt)
voxel_size = [info.PixelSpacing; info.SliceThickness]'
%read slice images; populate XYZ matrix
hWaitBar = waitbar(0,'Reading DICOM files');
for i=length(fnum):-1:1
fname = [prefix num2str(fnum(i)) ext];
D(:,:,i) = uint16(dicomread(fname));
waitbar((length(fnum)-i)/length(fnum))
end
delete(hWaitBar)
whos D
%% Visualization
%explore image data using Image Viewer GUI tool
i = 30; %middle slice
im = squeeze(D(:,:,i));
max_level = double(max(D(:)));
imview(im,[0 max_level])
%custom display - image data
fig1 = figure;
imshow(im,[0 max_level])
title('Coronal Slice #30')
set(fig1,'position',[601 58 392 314])
imview close all
%add intensity legend
colorbar
%change colormap
colormap jet
%3D visualization (doc: contourslice, isosurface & isocap)
docsearch('visualizing mri data')
%explore 3D volumetric data using Slice-O-Matic GUI tool (nobkpt)
addpath('D:\work\Demos\others\sliceomatic')
sliceomatic(double(D))
%ref: submission #780 @ www.mathworks.com/matlabcentral (nobkpt)
hSlico1 = gcf;
daspect(1./voxel_size)
movegui('northwest')
%reorient data for easier interpretation (stand patient up)
D = permute(D,[3 2 1]);
voxel_size = voxel_size([1 3 2]);
for i=1:3
D = flipdim(D,i);
%explore rotated 3D volume (new Slice-O-Matic viwer) - nobkpt
if ishandle(hSlico1), delete(hSlico1), end
hSlico2 = gcf;
set(hSlico2,'position',[455 63 560 420])
%intensity distribution also useful (more custom graphics)
%max_level = double(max(D(:)));
my_map = jet(max_level);
fig2 = figure;
%intensity distribution - top 2/3 (nobkpt)
subplot(3,1,1:2)
hist(double(im(:)),max_level)
axis([0 max_level 0 900])
title('Distribution')
%color scale - bottom 1/3 (nobkpt)
subplot(3,1,3)
imagesc(1:max_level)
colormap(my_map)
xlim([0 max_level])
set(gca,'ytick',[])
ylabel('Color Map')
xlabel('Intensity')
set(fig2,'position',[22 60 560 300],'render','zbuffer')
set(fig1,'position',[601 68 392 314])
figure(fig1)
%% Segmentation
%ignore low levels (backround air, CSF & other soft? tissues)
%using custom GUI tool to select best threshold level
im = imrotate(squeeze(D(30,:,:)),90);
figure(hSlico2)
%remove some figures (no longer needed) - nobkpt
if ishandle(fig1), delete(fig1), end
if ishandle(fig2), delete(fig2), end
doc graythresh
%custom GUI tool (nobkpt)
thresh_tool(im)
%duplicate original data set for later reference (nobkpt)
D1 = D;
%apply some thresholding rules to ignore certain parts of data
D(D=100) = 0; %ignore high levels (skull & other hard? tissues)
D(:,:,1:60) = 0; %ignore spatially low positions (below brain mass)
update_sliceomatic(double(D),hSlico2)
%erode away thick layer (dissolve thin surrounding tissues)
blk = ones([3 7 7]);
D = imerode(D,blk);
%isolate brain mass (bwlabeln)
doc bwlabel
lev = graythresh(double(im)/max_level) * max_level;
bw = (D>=lev);
L = bwlabeln(bw);
%connected region properties - how many, how big?
doc regionprops
stats = regionprops(L,'Area')
A = [stats.Area];
biggest = find(A==max(A))
%remove smaller scraps
D(L~=biggest) = 0;
%grow back main region (brian mass) - nobkpt
D = imdilate(D,blk);
%separate white vs. gray matter
lev2 = thresh_tool(im,'gray')
%partition brain mass (nobkpt)
lev2 = 67;
L = zeros(size(D)); %0=outside brain (head/air)
L(D0) = 2; %2=gray matter
L(D>=lev2) = 3; %3=white matter
%new Slice-O-Matic viewer (label matrix) - nobkpt
sliceomatic(L)
hSlico3 = gcf;
set(hSlico3,'position',[455 63 560 420])
%remove previous slicomatic viewer (nobkpt)
if ishandle(hSlico2), delete(hSlico2), end
%% Volumetric Measurements (voxel counting)
%total volume of brain (liters)
brain_voxels = length(find(L(:)>1));
brain_volume = brain_voxels*prod(voxel_size)/1e6
%volume of gray matter (liters) - nobkpt
gray_voxels = length(find(L(:)==2));
gray_volume = gray_voxels*prod(voxel_size)/1e6
%volume of white matter (liters) - nobkpt
white_voxels = length(find(L(:)==3));
white_volume = white_voxels*prod(voxel_size)/1e6
%density calculations (volume ratios) - nobkpt
gray_fraction = gray_volume/brain_volume
white_fraction = white_volume/brain_volume
return
%% Separate head from background for visualization (advanced maneuver)
%duplicate data
L1 = L;
%exterior of head (connected inside through ears)
%new Slice-O-Matic viewer (binary data) - nobkpt
BW = (D1
01 January 1970 1,056 2 View
Dear Researchers I am trying to perform a PIL simulation using STM32F4 Discovery board and comunication serial USB TO TTL. During simulation I receive the following timeout error: An error...
01 March 2021 2,327 1 View
The following code (see 1st 2 images attached) is used to produce PID controller values that are designed to control the system (G). The code finds the PID controller values (noted as k) by using...
28 February 2021 6,560 14 View
I have input and output data set for "ANFIS modeling in MATLAB", and I am getting some negative predicted values of output in testing. However, the predicted values of output in training are...
28 February 2021 3,459 3 View
I am required to learn about Flyback converters and I got stuck not knowing to full design of the power supply flyback converter Based USB Charger Model using Simulink, especially the design model...
25 February 2021 5,435 2 View
I do need the Matlab code of Fractal Discrete Cosine Transform (FDCT). Can anyone who has already implement this code, help me with the implementation of this transform?
24 February 2021 5,602 2 View
Hi Hope you are well. Can you please share your code for D2D implementation in Matlab. I want to implement D2D in Matlab based Vienna simulator and struggling to deploy D2D. Thanks
24 February 2021 9,378 3 View
Dear colleagues If anyone has a model of multi-effect distillation in EES or MATLAB software, please send it to me.
24 February 2021 7,282 1 View
Hi, I am a third year chemistry undergrad doing my group project in which I need to predict the HPLC retention time of 20 aromatic molecules. to do this we require the chemical properties of these...
24 February 2021 1,384 3 View
I use Matlab 2014b to capture some images with a PointGrey camera connected with USB3 port. I initialize the camera in a function which basically execute these followed lines : vid =...
22 February 2021 6,386 1 View
I have just recently started a new "weekend project" in addition to my master's studies and I am looking for a data-set. I would like to use some Operations Research to design an optimal gym...
22 February 2021 8,023 1 View