From: Heeteak Chung on
Hello Matlab
I'm running a simple code which imports a TIFF image and does a simple analysis.
Originally, I coded this using another computer. When I moved to another computer and try to run it, it gave me an error stated "??? Undefined function or method 'wiener2' for input arguments of type 'double'."

When I type which wiener2 -all, it returned "C:\Program Files\MATLAB\R2008b\toolbox\images\images\wiener2.m % Has no license available".

The function imrotate gave me the same no license issue.

Can anyone tell me what's going on here?
I'm pasting the content of the code below.
thanks in advance...


clear all
close all
clc

%read in TIF image%
info=imfinfo('ACB5_MLC_JanMonthly2010.tif');
image2=wiener2(double(imread('ACB5_MLC_JanMonthly2010','tif')), [5 5]);
resolution=(info.XResolution/25.4)^-1; %unit: mm
tempI=-log10(image2./(info.MaxSampleValue-1));
% tempI=I./(max(I(:)));
%%%%

%Determine the angle of ratation%
%Use image to determine the center of the center MLC
figure, imagesc(tempI), impixelinfo, axis image
y1 = round(size(tempI,1)/2); %center y-index value
x1 = 287; %center x-index value
close
%%%%

%Crop image so that the center of the image matrix is the center of the
%center MLC
cropI=tempI(:,x1-250:x1+250);
%%%%

%Use cropped image to determine the bottle index of the center MLC strip.
figure, imagesc(cropI), impixelinfo, axis image
x1=250;
x2 = 256; %last row x-index value
y2 = 1057; %last row y-index value
close
%%%%

%specify the direction of rotation and rotate%
RotationAngle=(180/pi)*(acos((y2-y1)/sqrt((x2-x1)^2+(y2-y1)^2)));
if x2 < x1;
normI=imrotate(cropI, RotationAngle,'bilinear','crop');
elseif x2 > x1;
normI=imrotate(cropI, -RotationAngle,'bilinear','crop');
else x2 = x1;
normI = cropI;
end
%%%%

%Establish Coordinate system
xcoord=[-(size(normI,2)-floor(size(normI,2)/2))+1:(size(normI,2)-floor(size(normI,2)/2))-1].*resolution;
ycoord=[-(size(normI,1)-floor(size(normI,1)/2))+1:(size(normI,1)-floor(size(normI,1)/2))-1].*resolution;
normI=normI./(max(normI(:)));
%%%%

figure,
imagesc(xcoord, ycoord, normI), colormap(gray), axis image
impixelinfo
xlabel('Cross-Plane (mm)')
ylabel('In-Plane (mm)')


figure, hold on
plot(normI(round(size(tempI,1)/2),:))
xlabel('Cross-Plane (mm)')
ylabel('Percent Height')

%Find each peaks
TempProfile=normI(round(size(tempI,1)/2),:);
[n,m]=find(TempProfile >= 0.5);

countemp=0;
count=0;
for ii=1:length(m)-1
if TempProfile(1,m(ii)) < TempProfile(1,m(ii+1))
countemp=countemp+1;
TempPeakIndex(1,countemp)=m(ii+1);
elseif TempProfile(1,m(ii)) == TempProfile(1,m(ii+1))
count=count+1;
PeakIndex(1,count)=TempPeakIndex(1,end);
else
count=count+1;
PeakIndex(1,count)=TempPeakIndex(1,end);
end
end
clear ii jj count countemp n m

count=0;
for ii=1:length(PeakIndex)-1
if PeakIndex(1,ii)-PeakIndex(1,ii+1) ~= 0
count=count+1;
Index(1,count)=PeakIndex(1,ii+1);
else
end
end
clear ii count
%%%

ApexIndex=[PeakIndex(1,1), Index(1,1), Index(1,3), Index(1,4)]; %Column index for all four MLC lines.
%Determine this from profiles and pick the peaks.

threshold=5; %Number of index that will be evaluated from the peak.
%During analysis, if it gives you an error about not having distinct
%values, you need to make the threshold smaller.

lines=[200:5:900]; %Number of profile samples per line.

close all
From: Nathan on
On Jan 26, 12:15 pm, "Heeteak Chung" <hee...(a)yahoo.com> wrote:
> Hello Matlab
> I'm running a simple code which imports a TIFF image and does a simple analysis.
> Originally, I coded this using another computer.  When I moved to another computer and try to run it, it gave me an error stated "??? Undefined function or method 'wiener2' for input arguments of type 'double'."  
>
> When I type which wiener2 -all, it returned "C:\Program Files\MATLAB\R2008b\toolbox\images\images\wiener2.m  % Has no license available".
>
> The function imrotate gave me the same no license issue.
>
> Can anyone tell me what's going on here?
> I'm pasting the content of the code below.
> thanks in advance...
>
> clear all
> close all
> clc
>
> %read in TIF image%
> info=imfinfo('ACB5_MLC_JanMonthly2010.tif');
> image2=wiener2(double(imread('ACB5_MLC_JanMonthly2010','tif')), [5 5]);
> resolution=(info.XResolution/25.4)^-1;  %unit: mm
> tempI=-log10(image2./(info.MaxSampleValue-1));
> % tempI=I./(max(I(:)));
> %%%%
>
> %Determine the angle of ratation%
> %Use image to determine the center of the center MLC
> figure, imagesc(tempI), impixelinfo, axis image
> y1 = round(size(tempI,1)/2);  %center y-index value
> x1 = 287;  %center x-index value
> close
> %%%%
>
> %Crop image so that the center of the image matrix is the center of the
> %center MLC
> cropI=tempI(:,x1-250:x1+250);
> %%%%
>
> %Use cropped image to determine the bottle index of the center MLC strip.
> figure, imagesc(cropI), impixelinfo, axis image
> x1=250;
> x2 = 256;  %last row x-index value
> y2 = 1057; %last row y-index value
> close
> %%%%
>
> %specify the direction of rotation and rotate%
> RotationAngle=(180/pi)*(acos((y2-y1)/sqrt((x2-x1)^2+(y2-y1)^2)));
> if x2 < x1;
>     normI=imrotate(cropI, RotationAngle,'bilinear','crop');
> elseif x2 > x1;
>     normI=imrotate(cropI, -RotationAngle,'bilinear','crop');
> else x2 = x1;
>     normI = cropI;
> end
> %%%%
>
> %Establish Coordinate system
> xcoord=[-(size(normI,2)-floor(size(normI,2)/2))+1:(size(normI,2)-floor(size(normI,2)/2))-1].*resolution;
> ycoord=[-(size(normI,1)-floor(size(normI,1)/2))+1:(size(normI,1)-floor(size(normI,1)/2))-1].*resolution;
> normI=normI./(max(normI(:)));
> %%%%
>
> figure,
> imagesc(xcoord, ycoord, normI), colormap(gray), axis image
> impixelinfo
> xlabel('Cross-Plane (mm)')
> ylabel('In-Plane (mm)')
>
> figure, hold on
> plot(normI(round(size(tempI,1)/2),:))
> xlabel('Cross-Plane (mm)')
> ylabel('Percent Height')
>
> %Find each peaks
> TempProfile=normI(round(size(tempI,1)/2),:);
> [n,m]=find(TempProfile >= 0.5);
>
> countemp=0;
> count=0;
> for ii=1:length(m)-1
>     if TempProfile(1,m(ii)) < TempProfile(1,m(ii+1))
>         countemp=countemp+1;
>         TempPeakIndex(1,countemp)=m(ii+1);
>     elseif TempProfile(1,m(ii)) == TempProfile(1,m(ii+1))
>         count=count+1;
>         PeakIndex(1,count)=TempPeakIndex(1,end);
>     else
>         count=count+1;
>         PeakIndex(1,count)=TempPeakIndex(1,end);
>     end
> end
> clear ii jj count countemp n m
>
> count=0;
> for ii=1:length(PeakIndex)-1
>     if PeakIndex(1,ii)-PeakIndex(1,ii+1) ~= 0
>         count=count+1;
>         Index(1,count)=PeakIndex(1,ii+1);
>     else
>     end
> end
> clear ii count
> %%%
>
> ApexIndex=[PeakIndex(1,1), Index(1,1), Index(1,3), Index(1,4)]; %Column index for all four MLC lines.
> %Determine this from profiles and pick the peaks.
>
> threshold=5;  %Number of index that will be evaluated from the peak.
> %During analysis, if it gives you an error about not having distinct
> %values, you need to make the threshold smaller.
>
> lines=[200:5:900];  %Number of profile samples per line.
>
> close all

Do you have the image processing toolbox installed?
Type "ver" in the matlab command window (without quotes) to see what
toolboxes you have installed. wiener2 and imrotate are part of the
image processing toolbox.

-Nathan
From: Heeteak Chung on
Hi Nathan,

I should have the image toolbox installed. Here is what it came back to me when I typed "ver".

-------------------------------------------------------------------------------------
MATLAB Version 7.7.0.471 (R2008b)
MATLAB License Number: 163130
Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 3)
Java VM Version: Java 1.6.0_04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
-------------------------------------------------------------------------------------
MATLAB Version 7.7 (R2008b)
Curve Fitting Toolbox Version 1.2.2 (R2008b)
Genetic Algorithm and Direct Search Toolbox Version 2.4 (R2008b)
Image Processing Toolbox Version 6.2 (R2008b)
Instrument Control Toolbox Version 2.7 (R2008b)
MATLAB Builder NE Version 3.0 (R2008b)
MATLAB Compiler Version 4.9 (R2008b)
Neural Network Toolbox Version 6.0.1 (R2008b)
Optimization Toolbox Version 4.1 (R2008b)
Parallel Computing Toolbox Version 4.0 (R2008b)
Signal Processing Toolbox Version 6.10 (R2008b)
Spline Toolbox Version 3.3.5 (R2008b)
Statistics Toolbox Version 7.0 (R2008b)
Wavelet Toolbox Version 4.3 (R2008b)

what do you think?
any suggestions?

"Heeteak Chung" <heechi(a)yahoo.com> wrote in message <hjnigp$j0p$1(a)fred.mathworks.com>...
> Hello Matlab
> I'm running a simple code which imports a TIFF image and does a simple analysis.
> Originally, I coded this using another computer. When I moved to another computer and try to run it, it gave me an error stated "??? Undefined function or method 'wiener2' for input arguments of type 'double'."
>
> When I type which wiener2 -all, it returned "C:\Program Files\MATLAB\R2008b\toolbox\images\images\wiener2.m % Has no license available".
>
> The function imrotate gave me the same no license issue.
>
> Can anyone tell me what's going on here?
> I'm pasting the content of the code below.
> thanks in advance...
>
>
> clear all
> close all
> clc
>
> %read in TIF image%
> info=imfinfo('ACB5_MLC_JanMonthly2010.tif');
> image2=wiener2(double(imread('ACB5_MLC_JanMonthly2010','tif')), [5 5]);
> resolution=(info.XResolution/25.4)^-1; %unit: mm
> tempI=-log10(image2./(info.MaxSampleValue-1));
> % tempI=I./(max(I(:)));
> %%%%
>
> %Determine the angle of ratation%
> %Use image to determine the center of the center MLC
> figure, imagesc(tempI), impixelinfo, axis image
> y1 = round(size(tempI,1)/2); %center y-index value
> x1 = 287; %center x-index value
> close
> %%%%
>
> %Crop image so that the center of the image matrix is the center of the
> %center MLC
> cropI=tempI(:,x1-250:x1+250);
> %%%%
>
> %Use cropped image to determine the bottle index of the center MLC strip.
> figure, imagesc(cropI), impixelinfo, axis image
> x1=250;
> x2 = 256; %last row x-index value
> y2 = 1057; %last row y-index value
> close
> %%%%
>
> %specify the direction of rotation and rotate%
> RotationAngle=(180/pi)*(acos((y2-y1)/sqrt((x2-x1)^2+(y2-y1)^2)));
> if x2 < x1;
> normI=imrotate(cropI, RotationAngle,'bilinear','crop');
> elseif x2 > x1;
> normI=imrotate(cropI, -RotationAngle,'bilinear','crop');
> else x2 = x1;
> normI = cropI;
> end
> %%%%
>
> %Establish Coordinate system
> xcoord=[-(size(normI,2)-floor(size(normI,2)/2))+1:(size(normI,2)-floor(size(normI,2)/2))-1].*resolution;
> ycoord=[-(size(normI,1)-floor(size(normI,1)/2))+1:(size(normI,1)-floor(size(normI,1)/2))-1].*resolution;
> normI=normI./(max(normI(:)));
> %%%%
>
> figure,
> imagesc(xcoord, ycoord, normI), colormap(gray), axis image
> impixelinfo
> xlabel('Cross-Plane (mm)')
> ylabel('In-Plane (mm)')
>
>
> figure, hold on
> plot(normI(round(size(tempI,1)/2),:))
> xlabel('Cross-Plane (mm)')
> ylabel('Percent Height')
>
> %Find each peaks
> TempProfile=normI(round(size(tempI,1)/2),:);
> [n,m]=find(TempProfile >= 0.5);
>
> countemp=0;
> count=0;
> for ii=1:length(m)-1
> if TempProfile(1,m(ii)) < TempProfile(1,m(ii+1))
> countemp=countemp+1;
> TempPeakIndex(1,countemp)=m(ii+1);
> elseif TempProfile(1,m(ii)) == TempProfile(1,m(ii+1))
> count=count+1;
> PeakIndex(1,count)=TempPeakIndex(1,end);
> else
> count=count+1;
> PeakIndex(1,count)=TempPeakIndex(1,end);
> end
> end
> clear ii jj count countemp n m
>
> count=0;
> for ii=1:length(PeakIndex)-1
> if PeakIndex(1,ii)-PeakIndex(1,ii+1) ~= 0
> count=count+1;
> Index(1,count)=PeakIndex(1,ii+1);
> else
> end
> end
> clear ii count
> %%%
>
> ApexIndex=[PeakIndex(1,1), Index(1,1), Index(1,3), Index(1,4)]; %Column index for all four MLC lines.
> %Determine this from profiles and pick the peaks.
>
> threshold=5; %Number of index that will be evaluated from the peak.
> %During analysis, if it gives you an error about not having distinct
> %values, you need to make the threshold smaller.
>
> lines=[200:5:900]; %Number of profile samples per line.
>
> close all
From: Rune Allnor on
On 1 Feb, 18:56, "Heeteak Chung" <hee...(a)yahoo.com> wrote:
> Hi Nathan,
>
> I should have the image toolbox installed.  Here is what it came back to me when I typed "ver".
>
> ---------------------------------------------------------------------------­----------
> MATLAB Version 7.7.0.471 (R2008b)
> MATLAB License Number: 163130
> Operating System: Microsoft Windows XP Version 5.1 (Build 2600: Service Pack 3)
> Java VM Version: Java 1.6.0_04 with Sun Microsystems Inc. Java HotSpot(TM) Client VM mixed mode
> ---------------------------------------------------------------------------­----------
> MATLAB                                                Version 7.7        (R2008b)
> Curve Fitting Toolbox                                 Version 1.2.2      (R2008b)
> Genetic Algorithm and Direct Search Toolbox           Version 2..4        (R2008b)
> Image Processing Toolbox                              Version 6.2        (R2008b)
> Instrument Control Toolbox                            Version 2.7        (R2008b)
> MATLAB Builder NE                                     Version 3.0        (R2008b)
> MATLAB Compiler                                       Version 4.9        (R2008b)
> Neural Network Toolbox                                Version 6.0.1      (R2008b)
> Optimization Toolbox                                  Version 4.1        (R2008b)
> Parallel Computing Toolbox                            Version 4.0        (R2008b)
> Signal Processing Toolbox                             Version 6.10       (R2008b)
> Spline Toolbox                                        Version 3.3.5      (R2008b)
> Statistics Toolbox                                    Version 7.0        (R2008b)
> Wavelet Toolbox                                       Version 4.3        (R2008b)
>
> what do you think?
> any suggestions?

Ask whever is responsible for maintaining matlab on
your site. Make sure the last version of matlab is
installed, lisences are valid, network drives work -
that kind of stuff.

Rune
From: us on
"Heeteak Chung" <heechi(a)yahoo.com> wrote in message <hk74k7$l9c$1(a)fred.mathworks.com>...
> Hi Nathan,
>
> I should have the image toolbox installed. Here is what it came back to me when I typed "ver".
>
> Image Processing Toolbox Version 6.2 (R2008b)
> what do you think?
> any suggestions?

just two thoughts...
- did you install a trial version of the tbx(?)...
- do you run under a multi-user license(?)...

us