From e55868b6d690f48b851e2c55fb026d42936c08a2 Mon Sep 17 00:00:00 2001 From: Brian Wandell Date: Sat, 25 Jan 2020 16:51:49 -0800 Subject: [PATCH] Replaced ieRoi2Locs with ieRect2Locs, which is more correct. Fixed a couple of tutorials that (slightly) failed. Upgraded some of the ieROI functions --- camera/cameraMTF.m | 2 +- gui/chart/chartRectsDraw.m | 2 +- gui/roi/ieLocs2Rect.m | 3 +- gui/roi/ieROICreate.m | 26 ++++++++ gui/roi/ieROISelect.m | 61 +++++++++++++------ gui/roi/ieRect2Locs.m | 14 ++--- gui/roi/ieRoi2Locs.m | 8 ++- gui/roi/vcGetROIData.m | 2 +- gui/roi/vcROISelect.m | 7 +-- gui/vcGetFigure.m | 37 +++++++---- imgproc/vcimageVSNR.m | 2 +- metrics/ISO/ISO12233.m | 4 +- scene/macbeth/macbethROIs.m | 5 +- scene/reflectance/chartROI.m | 4 +- scene/reflectance/chartRectangles.m | 2 +- scene/sceneGet.m | 2 +- scene/sceneSet.m | 2 +- scripts/metrics/s_metricsMTFPixelSize.m | 2 +- .../metrics/s_metricsMTFSlantedBarInfrared.m | 4 +- .../scene/s_sceneDataExtractionAndPlotting.m | 2 +- sensor/sensorGet.m | 2 +- tutorials/development/t_codeROI.m | 2 +- tutorials/gui/t_ROIDraw.m | 17 +++--- tutorials/image/t_ipDemosaic.m | 3 +- tutorials/sensor/t_sensorInterpolation.m | 16 +++-- utility/plots/ipPlot.m | 6 +- utility/plots/scenePlot.m | 2 +- validate/v_roiSet.m | 4 +- 28 files changed, 154 insertions(+), 89 deletions(-) create mode 100644 gui/roi/ieROICreate.m diff --git a/camera/cameraMTF.m b/camera/cameraMTF.m index 67496e15..b2984cb9 100644 --- a/camera/cameraMTF.m +++ b/camera/cameraMTF.m @@ -43,7 +43,7 @@ % h = ieDrawRect(a,rect,[1 0 1],3); % delete(h) -roiLocs = ieRoi2Locs(rect); +roiLocs = ieRect2Locs(rect); barImage = vcGetROIData(ip,roiLocs,'results'); c = rect(3)+1; r = rect(4)+1; diff --git a/gui/chart/chartRectsDraw.m b/gui/chart/chartRectsDraw.m index 3e77494a..7cb71451 100644 --- a/gui/chart/chartRectsDraw.m +++ b/gui/chart/chartRectsDraw.m @@ -21,7 +21,7 @@ %% Find corners of the rectangles. -% Should be a function. Used in ieRoi2Locs, also. Possibly other places +% Maybe this should edited to use ieRect2Vertices cmin = rects(:,1); cmax = rects(:,1)+rects(:,3); rmin = rects(:,2); rmax = rects(:,2)+rects(:,4); diff --git a/gui/roi/ieLocs2Rect.m b/gui/roi/ieLocs2Rect.m index 4f6529be..476f9ad1 100644 --- a/gui/roi/ieLocs2Rect.m +++ b/gui/roi/ieLocs2Rect.m @@ -12,7 +12,8 @@ % roiLocs2 = ieLocs2Rect(rect); % isequal(roiLocs,roiLocs2) % -% See also: ieGetXYCoords, ieRoi2Locs, vcROISelect, vcLineSelect, vcPointSelect +% See also: +% ieGetXYCoords, ieRect2Locs, vcROISelect, vcLineSelect, vcPointSelect % % (c) Imageval Consulting, LLC 2012 diff --git a/gui/roi/ieROICreate.m b/gui/roi/ieROICreate.m new file mode 100644 index 00000000..85a852b7 --- /dev/null +++ b/gui/roi/ieROICreate.m @@ -0,0 +1,26 @@ +function roi = ieRoiCreate(varargin) +% Create an ROI struct +% +% Syntax +% roi = ieRoiCreate(varargin) +% +% Description +% We are starting to create and show more ROIs, storing them in the ip, +% sensor, oi, and scene windows. This is just the initial development of +% that code. +% +% Also, we need to do some more work integrating all of the ROI functions +% in the gui/roi directory. There will be an ieRoiSet/Get/Plot +% +% Inputs +% +% Optional key/value pairs +% +% Returns +% roi - a struct, though maybe it will become an roi class +% +% Wandell, January 25 2020 +% +% See also +% vcROISelect; ieROIDraw, ieRect2Locs + diff --git a/gui/roi/ieROISelect.m b/gui/roi/ieROISelect.m index 4899957a..dd0fffa5 100644 --- a/gui/roi/ieROISelect.m +++ b/gui/roi/ieROISelect.m @@ -1,42 +1,69 @@ -function [roiLocs,rect] = ieROISelect(obj,objFig) +function [roiLocs,rect] = ieROISelect(obj,objFig,varargin) % Select a region of interest (ROI) from an image and calculate locations % -% [roiLocs,rect] = ieROISelect(obj,[objFig]) +% Syntax +% [roiLocs,rect] = ieROISelect(obj,[objFig],varargin) % +% Description % The row and col locations of the region of interest (ROI) are returned % in the Nx2 matrix, roiLocs. % % If requested, the selected rectangle (rect) determining the region of % interest, [colmin,rowmin,width,height], is also returned. % -% Example: -% ip = ieGetObject('ip'); -% [roiLocs, rect] = ieROISelect(ip); -% iData = ieROISelect(vci,roiLocs,'results'); +% Input +% obj - An ISETCam structure (scene, oi, sensor, ip) % -% See also: ieRoi2Locs +% Optional key/val pairs +% +% Return +% roiLocs +% rect % % Copyright ImagEval Consultants, LLC, 2005. +% +% See also: +% ieRoiDraw, ieRect2Locs, ieRoiCreate -% TODO: See proposal for ieOpenWindow below. We should also add -% ieRoiSelect to plan for deprecation of the vcXXX routines. +% Examples: +%{ + scene = sceneCreate; sceneWindow(scene); + [~,rect] = ieROISelect(scene); + r = ieROIDraw('scene','shape','rect','shape data',rect); + delete(r); +%} +%{ + ip = ieGetObject('ip'); + [roiLocs, rect] = ieROISelect(ip); + r = ieROIDraw('ip','shape','rect','shape data',rect); +%} +%{ + ip = ieGetObject('ip'); + ip = ipSet(ip,'roi',rect); + ipPlot(ip,'roi'); +%} +%% if ieNotDefined('obj'), error('You must define an object (isa,oi,scene ...)'); end if ieNotDefined('objFig') - objFig = vcGetFigure(obj); + objFig = vcGetFigure(obj); + + % If the returned figure is empty, the user probably did not set up the + % object window yet. So we add the object to the database and open the + % window if isempty(objFig) % We should add ieAddAndSelect() - ieAddObject(obj); + % ieAddObject(obj); % Should become ieOpenWindow(obj) switch obj.type case 'scene' - objFig = sceneWindow; + objFig = sceneWindow(obj); case 'opticalimage' - objFig = oiWindow; + objFig = oiWindow(obj); case 'sensor' - objFig = sensorWindow; + objFig = sensorWindow(obj); case 'vcimage' - objFig = ipWindow; + objFig = ipWindow(obj); otherwise error('Unknown obj type %s\n',obj.type); end @@ -61,7 +88,7 @@ end % Transform the rectangle into ROI locations -roiLocs = ieRoi2Locs(rect); +roiLocs = ieRect2Locs(rect); -return; +end diff --git a/gui/roi/ieRect2Locs.m b/gui/roi/ieRect2Locs.m index 43a0bfeb..5f5f6921 100644 --- a/gui/roi/ieRect2Locs.m +++ b/gui/roi/ieRect2Locs.m @@ -14,17 +14,13 @@ % rect = round(getrect(ieSessionGet('ipwindow'))); % roiLocs = ieRect2Locs(rect); % -% Usually we call the routine vcROISelect directly, which calls this +% Usually we call the routine ieROISelect directly, which calls this % routine: -% vci = vcGetObject('vcimage'); -% [roiLocs roiRect] = vcROISelect(vci); -% -% -% See also: Uh oh, there is a routine ieROI2Locs which looks pretty much -% like this one. % % (c) Imageval, 2004 -% See also: vcROISelect(), ieLocs2Rect +% +% See also: +% ieROISelect, ieLocs2Rect % % The rect entries are (colMin,rowMin,colWidth-1,rowWidth-1) @@ -36,4 +32,4 @@ [c,r] = meshgrid(cmin:cmax,rmin:rmax); roiLocs = [r(:),c(:)]; -return; \ No newline at end of file +end \ No newline at end of file diff --git a/gui/roi/ieRoi2Locs.m b/gui/roi/ieRoi2Locs.m index f6667ebb..6e262813 100644 --- a/gui/roi/ieRoi2Locs.m +++ b/gui/roi/ieRoi2Locs.m @@ -1,5 +1,5 @@ function roiLocs = ieRoi2Locs(rect) -% Should be called ieRect2Locs +% ****** Deprecated: Call ieRect2Locs ***** % % roiLocs = ieRoi2Locs(rect) % @@ -23,7 +23,12 @@ % vcROISelect(), ieLocs2Rect % +warning('Call ieRect2Locs, not ieRoi2Locs. This routine is deprecated.'); +roiLocs = ieRect2Locs(rect); +end + +%{ % The rect entries are The number of data % values are colMax - colMin +1 and similarly for the row cmin = rect(1); cmax = rect(1)+rect(3); @@ -33,3 +38,4 @@ roiLocs = [r(:),c(:)]; return; +%} \ No newline at end of file diff --git a/gui/roi/vcGetROIData.m b/gui/roi/vcGetROIData.m index cef251cc..0eb042a7 100644 --- a/gui/roi/vcGetROIData.m +++ b/gui/roi/vcGetROIData.m @@ -59,7 +59,7 @@ elseif size(roiLocs,2) == 4 % The user sent a rect. Convert to roiLocs. % Be alert to the problem of the rect size in comments, above - roiLocs = ieRoi2Locs(roiLocs); + roiLocs = ieRect2Locs(roiLocs); end %% diff --git a/gui/roi/vcROISelect.m b/gui/roi/vcROISelect.m index 0c4d7b0f..a97ae021 100644 --- a/gui/roi/vcROISelect.m +++ b/gui/roi/vcROISelect.m @@ -14,7 +14,7 @@ % [roiLocs, rect] = vcROISelect(vci); % iData = vcGetROIData(vci,roiLocs,'results'); % -% See also: ieRoi2Locs +% See also: ieRect2Locs % % Copyright ImagEval Consultants, LLC, 2005. @@ -61,7 +61,6 @@ end % Transform the rectangle into ROI locations -roiLocs = ieRoi2Locs(rect); - -return; +roiLocs = ieRect2Locs(rect); +end diff --git a/gui/vcGetFigure.m b/gui/vcGetFigure.m index 48bd9265..7f17e2d5 100644 --- a/gui/vcGetFigure.m +++ b/gui/vcGetFigure.m @@ -1,28 +1,39 @@ function figNum = vcGetFigure(obj) % Return the figure number associated with an object. % -% figNum = vcGetFigure(obj) +% Syntax +% figNum = vcGetFigure(obj) % -% Possible ISET objects are scene, opticalimage, isa, vcimage. This -% routine allows us to get the figure number when the object type is not -% identified in the main routine, such as getting an ROI for an oi, +% Description +% Get the figure handle to one of the ISETCam windows. Possible ISET +% objects are scene, oi, sensor, ip. +% +% This routine allows us to get the figure number when the object type is +% not identified in the main routine, such as getting an ROI for an oi, % scene, sensor or other type of window. % % There is a separate routine for GraphWins. But I am not sure why. % -% Examples: -% figNum = vcGetFigure(obj) -% figure(figNum); -% handles = guihandle(figNum); -% % Copyright ImagEval Consultants, LLC, 2005. +% +% See also +% vcEquivalentObjtype, vcGetObjectType + +% Examples: +%{ + scene = sceneCreate; sceneWindow(scene); + figNum = vcGetFigure(scene) + figure(figNum); + handles = guihandles(figNum); +%} -% global vcSESSION; - +%% objType = vcGetObjectType(obj); + +% Forces the objType string to one of original names below. objType = vcEquivalentObjtype(objType); -hdl = []; +% hdl = []; switch lower(objType) case 'scene' figNum = ieSessionGet('scenewindow'); @@ -37,4 +48,4 @@ error('Unknown object type.'); end -return; \ No newline at end of file +end \ No newline at end of file diff --git a/imgproc/vcimageVSNR.m b/imgproc/vcimageVSNR.m index 79aa5c82..91c6b8c1 100644 --- a/imgproc/vcimageVSNR.m +++ b/imgproc/vcimageVSNR.m @@ -26,7 +26,7 @@ % Select the ROI from the vcimage window if ieNotDefined('rect'), [roiLocs,rect] = vcROISelect(vci); -else roiLocs = ieRoi2Locs(rect); +else, roiLocs = ieRect2Locs(rect); end % a = get(ipWindow,'CurrentAxes'); hold(a,'on'); ieDrawRect(a,rect) % Convert the data to an XYZ image diff --git a/metrics/ISO/ISO12233.m b/metrics/ISO/ISO12233.m index 15f85e73..5a0a7bd6 100644 --- a/metrics/ISO/ISO12233.m +++ b/metrics/ISO/ISO12233.m @@ -61,7 +61,7 @@ %The whole thing and cpd assuming a 1m viewing distance rectMTF = [xmin ymin width height]; c = rectMTF(3)+1; r = rectMTF(4)+1; - roiMTFLocs = ieRoi2Locs(rectMTF); + roiMTFLocs = ieRect2Locs(rectMTF); barImage = vcGetROIData(vciBlurred,roiMTFLocs,'results'); barImage = reshape(barImage,r,c,3); wgts = [ 0.3 0.6 0.1]; @@ -98,7 +98,7 @@ % The barImage is really the image processor (ip) ip = barImage; rect = ISOFindSlantedBar(ip); - roiLocs = ieRoi2Locs(rect); + roiLocs = ieRect2Locs(rect); barImage = vcGetROIData(ip,roiLocs,'results'); col = rect(3)+1; row = rect(4)+1; diff --git a/scene/macbeth/macbethROIs.m b/scene/macbeth/macbethROIs.m index fa9b2c48..37cd7998 100644 --- a/scene/macbeth/macbethROIs.m +++ b/scene/macbeth/macbethROIs.m @@ -19,7 +19,6 @@ rect(3) = delta; rect(4) = delta; -patchLocs = ieRoi2Locs(rect); - -return; +patchLocs = ieRect2Locs(rect); +end diff --git a/scene/reflectance/chartROI.m b/scene/reflectance/chartROI.m index 3412ca6f..c086c33d 100644 --- a/scene/reflectance/chartROI.m +++ b/scene/reflectance/chartROI.m @@ -19,7 +19,7 @@ % Copyright ImagEval Consultants, LLC, 2014 % % See also: -% chartPatchData, chartRectangles,ieRoi2Locs +% chartPatchData, chartRectangles,ieRect2Locs %% if ieNotDefined('currentLoc'), error('current location in chart is required'); end @@ -35,7 +35,7 @@ rect(4) = delta; %% Convert the rect into the positions -patchLocs = ieRoi2Locs(rect); +patchLocs = ieRect2Locs(rect); end diff --git a/scene/reflectance/chartRectangles.m b/scene/reflectance/chartRectangles.m index 29d7c66b..1e8284e9 100644 --- a/scene/reflectance/chartRectangles.m +++ b/scene/reflectance/chartRectangles.m @@ -77,7 +77,7 @@ %% The rectangles -% You can use ieRoi2Locs to return the locations within the rects +% You can use ieRect2Locs to return the locations within the rects nPatches = size(mLocs,2); rects = zeros(nPatches,4); for ii=1:nPatches diff --git a/scene/sceneGet.m b/scene/sceneGet.m index 4683a614..d5dab44d 100644 --- a/scene/sceneGet.m +++ b/scene/sceneGet.m @@ -294,7 +294,7 @@ % We should also implement: % r = sceneGet(scene,'mean reflectance',roiRect); % - % radiance = vcGetROIData(scene,ieRoi2Locs(rect),'photons'); + % radiance = vcGetROIData(scene,ieRect2Locs(rect),'photons'); % illuminantSPD = sceneGet(scene,'illuminant photons'); % reflectance = radiance*diag(1./illuminantSPD); % reflectance = mean(reflectance); diff --git a/scene/sceneSet.m b/scene/sceneSet.m index 3f1f9e94..ae176ac5 100644 --- a/scene/sceneSet.m +++ b/scene/sceneSet.m @@ -220,7 +220,7 @@ if isempty(varargin), error('ROI required') else, roi = varargin{1}; end - if size(roi,2) == 4, roiLocs = ieRoi2Locs(roi); + if size(roi,2) == 4, roiLocs = ieRect2Locs(roi); else, roiLocs = roi; end diff --git a/scripts/metrics/s_metricsMTFPixelSize.m b/scripts/metrics/s_metricsMTFPixelSize.m index 546fbfbb..b5db3666 100644 --- a/scripts/metrics/s_metricsMTFPixelSize.m +++ b/scripts/metrics/s_metricsMTFPixelSize.m @@ -106,7 +106,7 @@ % ipWindow; rect = round(masterRect/pSize(ii)); - roiLocs = ieRoi2Locs(rect); + roiLocs = ieRect2Locs(rect); barImage = vcGetROIData(ip,roiLocs,'results'); c = rect(3)+1; diff --git a/scripts/metrics/s_metricsMTFSlantedBarInfrared.m b/scripts/metrics/s_metricsMTFSlantedBarInfrared.m index 8371b050..7693a2c5 100644 --- a/scripts/metrics/s_metricsMTFSlantedBarInfrared.m +++ b/scripts/metrics/s_metricsMTFSlantedBarInfrared.m @@ -14,7 +14,7 @@ % # Compute the MTF of the slanted edge target for this sensor % and spatial CFA % -% See also: sceneCreate, ieReadColorFilter, ieRoi2Locs, +% See also: sceneCreate, ieReadColorFilter, ieRect2Locs, % vcGetROIData, ISO12233 % % Copyright ImagEval Consultants, LLC, 2010 @@ -134,7 +134,7 @@ %% Calculate an MTF when you choose the rectangle -roiLocs = ieRoi2Locs(masterRect); +roiLocs = ieRect2Locs(masterRect); barImage = vcGetROIData(vci,roiLocs,'results'); c = masterRect(3)+1; diff --git a/scripts/scene/s_sceneDataExtractionAndPlotting.m b/scripts/scene/s_sceneDataExtractionAndPlotting.m index 4589997a..4c70688c 100644 --- a/scripts/scene/s_sceneDataExtractionAndPlotting.m +++ b/scripts/scene/s_sceneDataExtractionAndPlotting.m @@ -39,7 +39,7 @@ %% You can plot the spectral radiance energy from within an ROI rect = [51 35 10 11]; % Yellow Macbeth patch -roiLocs = ieRoi2Locs(rect); % xy locations in scene +roiLocs = ieRect2Locs(rect); % xy locations in scene scenePlot(scene,'radiance energy roi',roiLocs); %% Or plot the mean quanta (photons) at the same location diff --git a/sensor/sensorGet.m b/sensor/sensorGet.m index 37fe69df..e197e1c5 100644 --- a/sensor/sensorGet.m +++ b/sensor/sensorGet.m @@ -433,7 +433,7 @@ if checkfields(sensor,'roi') % The data can be stored as a rect or as roiLocs. val = sensor.roi; - if size(val,2) == 4, val = ieRoi2Locs(val); end + if size(val,2) == 4, val = ieRect2Locs(val); end end case {'roirect'} % sensorGet(sensor,'roi rect') diff --git a/tutorials/development/t_codeROI.m b/tutorials/development/t_codeROI.m index d33c3c6a..154b52ca 100644 --- a/tutorials/development/t_codeROI.m +++ b/tutorials/development/t_codeROI.m @@ -23,7 +23,7 @@ [roiLocs,rect] = vcROISelect(scene); % If you know the rect, and want to recover the roiLocs, use this -% roiLocs2 = ieRoi2Locs(rect); +% roiLocs2 = ieRect2Locs(rect); % isequal(roiLocs,roiLocs2) %% Get data from the object diff --git a/tutorials/gui/t_ROIDraw.m b/tutorials/gui/t_ROIDraw.m index da4ea4e5..06f60fa2 100644 --- a/tutorials/gui/t_ROIDraw.m +++ b/tutorials/gui/t_ROIDraw.m @@ -1,9 +1,12 @@ %% Draw some shapes (ROIs) on the main axes for ISET windows % -% The ROIs can be drawn and deleted. -% This is just the beginning of building up ROI capabilities +% The ROIs can be drawn and deleted. This is the beginning of building up +% ROI capabilities. +% +% The key routines are in the gui/roi directory. +% +% Wandell % -% BW %% ieInit @@ -27,14 +30,14 @@ scene = sceneCreate; rect = [20 50 10 5]; % row, col, width, height -[shapeHandle,ax] = ieROIDraw('scene','shape','rect','shape data',rect,'line width',5); +shapeHandle = ieROIDraw('scene','shape','rect','shape data',rect,'line width',5); shapeHandle.LineStyle = ':'; delete(shapeHandle); %% Rect on an oi rect = [50 50 20 20]; -[shapeHandle,ax] = ieROIDraw('oi','shape','rect','shape data',rect); +shapeHandle = ieROIDraw('oi','shape','rect','shape data',rect); shapeHandle.LineStyle = ':'; shapeHandle.EdgeColor = 'w'; delete(shapeHandle); @@ -42,7 +45,7 @@ %% Circle on an oi c = [10 20 20]; -[shapeHandle,ax] = ieROIDraw('oi','shape','circle','shape data',c); +shapeHandle = ieROIDraw('oi','shape','circle','shape data',c); shapeHandle.LineStyle = ':'; shapeHandle.EdgeColor = 'w'; delete(shapeHandle); @@ -50,7 +53,7 @@ %% Circle on a sensor c = [10 20 20]; -[shapeHandle,ax] = ieROIDraw('sensor','shape','circle','shape data',c); +shapeHandle = ieROIDraw('sensor','shape','circle','shape data',c); shapeHandle.Color = 'w'; delete(shapeHandle); diff --git a/tutorials/image/t_ipDemosaic.m b/tutorials/image/t_ipDemosaic.m index 83f6dd14..1133ef40 100644 --- a/tutorials/image/t_ipDemosaic.m +++ b/tutorials/image/t_ipDemosaic.m @@ -22,9 +22,8 @@ % This is the Demosaic call from inside of ipCompute (called also by % cameraCompute). In this illustration, there is no sensor or illuminant % correction -sensor = cameraGet(camera,'sensor'); -ip = cameraGet(camera,'ip'); fprintf('Demosaic method: %s\n',ipGet(ip,'demosaic method')); + d = Demosaic(ip,sensor); ieNewGraphWin; imagescRGB(d); diff --git a/tutorials/sensor/t_sensorInterpolation.m b/tutorials/sensor/t_sensorInterpolation.m index efde1631..84703fb4 100644 --- a/tutorials/sensor/t_sensorInterpolation.m +++ b/tutorials/sensor/t_sensorInterpolation.m @@ -1,7 +1,9 @@ -% We illustrate how to create sensor images at different spatial -% sampling rates and pixel sizes. This script analyzes different -% algorithms for interpolating the optical image (irradiance) onto -% pixels with different sizes. +%% t_sensorInterpolation +% +% We illustrate how to create sensor images at different spatial sampling +% rates and pixel sizes. This script analyzes different algorithms for +% interpolating the optical image (irradiance) onto pixels with different +% sizes. % % The critical calculations for managing pixel size and interpolation % are in sensorCompute within the routines @@ -14,7 +16,6 @@ % % See also % -s %% init ieInit; @@ -74,17 +75,14 @@ % sensorWindow(sensorLinear1); %% -%{ + [sensorLinear2, unitSigCurrent2] = sensorCompute(sensorLinear, oi); sensorLinear2 = sensorSet(sensorLinear2,'name','Linear 2 interp'); % sensorWindow(sensorLinear2); -%} -%{ v2 = sensorGet(sensorLinear2,'volts'); ieNewGraphWin; plot(v1(:),v2(:),'.'); identityLine; -%} %% sensorGauss = sensor; diff --git a/utility/plots/ipPlot.m b/utility/plots/ipPlot.m index e919661a..c665ec31 100644 --- a/utility/plots/ipPlot.m +++ b/utility/plots/ipPlot.m @@ -17,7 +17,7 @@ % Copyright Imageval Consulting, LLC 2015 % % See also -% +% ieROIDraw, ieROISelect %% Decode parameters @@ -60,8 +60,8 @@ % Make sure the sensor window is selected ipWindow; - g = rectangle('Position',ipGet(ip,'roi'),'EdgeColor','w','LineWidth',2); - + g = ieROIDraw('ip','shape','rect','shape data',ipGet(ip,'roi')); + otherwise error('Uknown parameter %s\n',param); end diff --git a/utility/plots/scenePlot.m b/utility/plots/scenePlot.m index 91b5845c..3efaa710 100644 --- a/utility/plots/scenePlot.m +++ b/utility/plots/scenePlot.m @@ -12,7 +12,7 @@ % % The roiLocs can usually be specified either as an Nx2 matrix of locations % or as a rect, in which case the rect is recognized and converted to -% roiLocs by the routine ieRoi2Locs (within vcGetROIData) +% roiLocs by the routine ieRect2Locs (within vcGetROIData) % % The values of the plot type (pType) are % diff --git a/validate/v_roiSet.m b/validate/v_roiSet.m index c2ec0027..2b885151 100644 --- a/validate/v_roiSet.m +++ b/validate/v_roiSet.m @@ -25,7 +25,7 @@ %% Now make sure it works with roiLocs format % This will darken the patch -roiLocs = ieRoi2Locs(shiftedRect); +roiLocs = ieRect2Locs(shiftedRect); shiftedSceneGray = sceneSet(scene,'roi photons',newPhotons/3,roiLocs); sceneWindow(shiftedSceneGray); @@ -43,7 +43,7 @@ %% Now make sure it works with roiLocs % This will darken the patch -roiLocs = ieRoi2Locs(shiftedRect); +roiLocs = ieRect2Locs(shiftedRect); shiftedSceneGray = sceneSet(scene,'roi energy',newEnergy/3,roiLocs); sceneWindow(shiftedSceneGray);