From: Murtaza Safri on 23 Jun 2010 10:43 "pkenned Kennedy" <pkenned(a)gmail.com> wrote in message <h5ullk$2fk$1(a)fred.mathworks.com>... > Hi everybody, > > I'm currently undertaking a Masters in Medical Physics and my project is based on quantifying the amount of fat in an MRI image. I had no knowledge whatsoever of MATLAB so please excuse me if my question has an obvious answer! > > What I want to do is read the image files into a 3-D array, then threshold each one to seperate the fat from the other tissues (the imaging sequence in the MRI machine shows fat as the highest intensity pixels) and create a binary image. I would then like to take a histogram of the binary image and calculate the fat mass from the pixel size and no. of them. > > So far I can read the images into an array using a handy program I found here created by Nipun Patel called ReadDicom4. I then created an empty matrix and filled it with the thresholded binary images. I would like to take a histogram of the image and extract a value for the pixels with intensity 1. How can I do this without manually using the data selector cursor on the histogram screen? > > Here's my code so far: > > M=ReadDicom4(200,220,'IM_',[]); %Read dicom images into matrix (200=start of sequence, 220=end of it and 'IM_' is the prefix before each file) > > C=zeros(320,320,21); % Creaty empty matrix > > for i=1:21 % 21 images in sequence > I=M(:,:,i); > lev=graythresh(I); % Threshold using MATLAB function > BW=im2bw(I,lev); % Create binary image > C(:,:,i)=BW; > end > > > If I have time I'd like to introduce a stage where if needed I can use roipoly to remove unwanted areas of high intensity e.g. noise and bone. > > Any help is much appreciated, and if somebody knows of an easier way to do what I'm trying to please speak up! > > > Thanks so much, > > Paul Hi Paul Try using clustering algorithms for detecting regions of homogenous intensity. For example use kmeans in matlab to cluster the region into several regions. One of those regions would be the fat tissue.
From: Murtaza Safri on 23 Jun 2010 10:45 "pkenned Kennedy" <pkenned(a)gmail.com> wrote in message <h5ullk$2fk$1(a)fred.mathworks.com>... > Hi everybody, > > I'm currently undertaking a Masters in Medical Physics and my project is based on quantifying the amount of fat in an MRI image. I had no knowledge whatsoever of MATLAB so please excuse me if my question has an obvious answer! > > What I want to do is read the image files into a 3-D array, then threshold each one to seperate the fat from the other tissues (the imaging sequence in the MRI machine shows fat as the highest intensity pixels) and create a binary image. I would then like to take a histogram of the binary image and calculate the fat mass from the pixel size and no. of them. > > So far I can read the images into an array using a handy program I found here created by Nipun Patel called ReadDicom4. I then created an empty matrix and filled it with the thresholded binary images. I would like to take a histogram of the image and extract a value for the pixels with intensity 1. How can I do this without manually using the data selector cursor on the histogram screen? > > Here's my code so far: > > M=ReadDicom4(200,220,'IM_',[]); %Read dicom images into matrix (200=start of sequence, 220=end of it and 'IM_' is the prefix before each file) > > C=zeros(320,320,21); % Creaty empty matrix > > for i=1:21 % 21 images in sequence > I=M(:,:,i); > lev=graythresh(I); % Threshold using MATLAB function > BW=im2bw(I,lev); % Create binary image > C(:,:,i)=BW; > end > > > If I have time I'd like to introduce a stage where if needed I can use roipoly to remove unwanted areas of high intensity e.g. noise and bone. > > Any help is much appreciated, and if somebody knows of an easier way to do what I'm trying to please speak up! > > > Thanks so much, > > Paul
|
Pages: 1 Prev: Ellipse Detection with matlab function Next: Permanently changing the CData of an image? |