From: Saurabh on 10 May 2010 06:37 I am making a code in which i have to divide two images using imdivide command. I am expecting to get assigned values to the image pixels between 0- 1 but the final outcome is values 0 and 1 (only integers). Is it possible to get better precision ( that is decimal points) rather than just integers . The Input is double array (every image). clear all;close all clc; HUmin = 0; % to select your image color HUmax = 1; % angle of rotation angle = 0; % Define where the files are stored:Dry core 120 KV pathname1 = uigetdir('D:\gp\My Documents\MATLAB\Saturation_Visualisation_19Apr23Apr2010\0997CO2_20Apr2010_120KV\19Apr_partIa_120KV_DRY_CORE\Series_4'); % Fill matrix 'd' with the file information d = dir(fullfile(pathname1,'*.dcm')); % Store the filenames separately in matrix 'dicomfiles' dicomfiles1 = {d.name}; % Count the number of dicom files, and define that count as the amount of % frames to be visualized S = numel(dicomfiles1); nframes = S; % Define where the files are stored:Saturated core 120 KV pathname2 = uigetdir('D:\gp\My Documents\MATLAB\Saturation_Visualisation_19Apr23Apr2010\0997CO2_20Apr2010_120KV\19Apr_partIIa_saturated_core_120KV\Series_6'); % Fill matrix 'd' with the file information e = dir(fullfile(pathname2,'*.dcm')); % Store the filenames separately in matrix 'dicomfiles' dicomfiles2 = {e.name}; % Count the number of dicom files, and define that count as the amount of % frames to be visualized % Define where the files are stored:0798 CO2 core 120 KV pathname3 = uigetdir('D:\gp\My Documents\MATLAB\Saturation_Visualisation_19Apr23Apr2010\0997CO2_20Apr2010_120KV\20Apr_partIVa_2004CO2_0997_120KV\Series_10'); % Fill matrix 'd' with the file information f = dir(fullfile(pathname3,'*.dcm')); % Store the filenames separately in matrix 'dicomfiles' dicomfiles3 = {f.name}; % Count the number of dicom files, and define that count as the amount of % frames to be visualized %%nn = 2; % In this loop we visualize each dicom file separately, and then store it % as a frame in the movie for i=1:nframes;% image number name1 = char(dicomfiles1(i)); % Read the dicom file: XX = dicomread([pathname1 '\' name1]); XX = imrotate(XX,angle,'bicubic','crop'); name2 = char(dicomfiles2(i)); % Read the dicom file: YY= dicomread([pathname2 '\' name2]); YY = imrotate(YY,angle,'bicubic','crop'); name3 = char(dicomfiles3(i)); % Read the dicom file: ZZ= dicomread([pathname3 '\' name3]); ZZ = imrotate(ZZ,angle,'bicubic','crop'); RR = ZZ - XX; WW=YY - XX; SS=imdivide(RR,WW); SS = imrotate(SS,angle,'bicubic','crop'); SS= imcrop(SS, [200,200,100,100]); %short core 19 12 08 % visualize the dicomfile figure imshow(SS) impixelinfo % Define the colormap colormap('jet') % Define the visualization window caxis([HUmin HUmax])
From: Mark Shore on 10 May 2010 07:47 "Saurabh " <saurabhs(a)student.ethz.ch> wrote in message <hs8no9$b08$1(a)fred.mathworks.com>... > I am making a code in which i have to divide two images using imdivide command. I am expecting to get assigned values to the image pixels between 0- 1 but the final outcome is values 0 and 1 (only integers). Is it possible to get better precision ( that is decimal points) rather than just integers . The Input is double array (every image). > > Are you positive your input is in double-precision floating point? Most image formats are unsigned 8 to 16 bit integers. Also, obviously, no one has access to your file path and images but you.
From: Steve Eddins on 10 May 2010 07:48 On 5/10/2010 6:37 AM, Saurabh wrote: > I am making a code in which i have to divide two images using imdivide > command. I am expecting to get assigned values to the image pixels > between 0- 1 but the final outcome is values 0 and 1 (only integers). Is > it possible to get better precision ( that is decimal points) rather > than just integers . The Input is double array (every image). > [snip - code deleted] Probably you aren't really passing double arrays to imdivide. Look carefully at the result of your call to dicomread to be sure. --- Steve Eddins http://blogs.mathworks.com/steve/
From: Saurabh on 10 May 2010 09:56 You are absolutely write - to be more specific I am 'reading 'DICOM files that contain metadata that provide information about the image data, such as the size, dimensions, bit depth, modality used to create the data, the equipment settings used to capture the image, and information about the study. The DICOM specification defines many of these metadata fields, but files can contain additional fields, called private metadata. It is from a COMPUTED Tomography X-ray Scan during core flooding and I want to have a 2D profile of Water Saturation in every slide taken.In each dicom file, a specific Hounsfield unit value is attributed to every pixel. Using the formula Water Saturation= (HU - HUdry/HUsaturated-HUdry) I want to do arithmetics pixel by pixel. I realised if I declare in the code: XX =double(dicomread([pathname1 '\' name1])); etc I can have the desired visualization. "Mark Shore" <mshore(a)magmageosciences.ca> wrote in message <hs8rnq$ses$1(a)fred.mathworks.com>... > "Saurabh " <saurabhs(a)student.ethz.ch> wrote in message <hs8no9$b08$1(a)fred.mathworks.com>... > > I am making a code in which i have to divide two images using imdivide command. I am expecting to get assigned values to the image pixels between 0- 1 but the final outcome is values 0 and 1 (only integers). Is it possible to get better precision ( that is decimal points) rather than just integers . The Input is double array (every image). > > > > > > > Are you positive your input is in double-precision floating point? Most image formats are unsigned 8 to 16 bit integers. > > Also, obviously, no one has access to your file path and images but you.
|
Pages: 1 Prev: Plotting a 3-D line plot with user defined axis. Next: percision in matlab command imdivide |