Code covered by the BSD License  

Highlights from
ImageNotes

image thumbnail

ImageNotes

by

 

ImageNotes provides an interface for blind analysis of images.

ImageNotes(varargin)
function varargout = ImageNotes(varargin)
% IMAGENOTES provides an interface for blind analysis of images. 
%     IMAGENOTES starts a GUI that allows you to select a set of image
%     files. (Using uipickfile.m copyright Douglas M. Schwarz). These files
%     are displayed in a random order with the name hidden. You can take
%     notes in the GUI on each file. When your notes are complete, the
%     names of the files can be revealed in the GUI and you can export a
%     .csv file with the names of each file and the corresponding notes.
%     IMAGENOTES also allows intensity scaling of grey scale images. 
%
% Copyright (c) Molly J. Rossow <molly@mollyrossow.com> Agust 28, 2013


% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name',       mfilename, ...
                   'gui_Singleton',  gui_Singleton, ...
                   'gui_OpeningFcn', @ImageNotes_OpeningFcn, ...
                   'gui_OutputFcn',  @ImageNotes_OutputFcn, ...
                   'gui_LayoutFcn',  [] , ...
                   'gui_Callback',   []);
if nargin && ischar(varargin{1})
    gui_State.gui_Callback = str2func(varargin{1});
end

if nargout
    [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
    gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT


% --- Executes just before ImageNotes is made visible.
function ImageNotes_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
% varargin   command line arguments to ImageNotes (see VARARGIN)

% Choose default command line output for ImageNotes
handles.output = hObject;

% Set handles values.
handles.fileNames = {}; % List of selected files names. Includes complete 
                        % path.
handles.fileIndex = 1; % Index of currently displayed file name. 
handles.numFiles = 0; % Total number of files selected. 
handles.directory = ''; % Directory of the first file selected. Files can 
                        % come from mulitple directories. 
handles.showFileName = 0; % 1 if file names are diplayed. 0 if they are 
                          % not.
handles.colLabel = 'Notes'; % Label of notes column in exported .csv file. 
handles.notes = {}; % Notes for each file. 
handles.scaleRange = []; % An empty vector if there is no scaling or 
                         % [min, max] if the the scale sliders have been
                         % moved.
handles.maxIntensity = 1; % Maximum intensity. Set when each image is read 
                          % in. 
handles.imData = []; % Image data. 
handles.colorMap = gray; % Default colormap
handles.hMinRefLine = 0; % handles to min line in histogram plot.
handles.hMaxRefLine = 0; % handles to max line histogram plot.


guidata(hObject, handles);


% --- Outputs from this function are returned to the command line.
function varargout = ImageNotes_OutputFcn(hObject, eventdata, handles) 
% varargout  cell array for returning output args (see VARARGOUT);
% hObject    handle to figure
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Get default command line output from handles structure
varargout{1} = handles.output;


% --- Executes on slider movement.
function slFileNumber_Callback(hObject, eventdata, handles)
% hObject    handle to slFileNumber (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
handles = fileSlider(handles);

% Update handles structure
guidata(hObject, handles);


% --- Executes during object creation, after setting all properties.
function slFileNumber_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slFileNumber (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end

% --- Executes on button press in rbShow.
function rbShow_Callback(hObject, eventdata, handles)
% hObject    handle to rbShow (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

%Toggle with rbHide.
set(handles.rbHide,'Value',0)
set(hObject,'Value',1)
handles.showFileName = 1;
updateFileName(handles)

% Update handles structure
guidata(hObject, handles);

% --- Executes on button press in rbHide.
function rbHide_Callback(hObject, eventdata, handles)
% hObject    handle to rbHide (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Toggle with rbShow.
set(handles.rbShow,'Value',0)
set(hObject,'Value',1)
handles.showFileName = 0;
updateFileName(handles)
% Update handles structure
guidata(hObject, handles);

function etLabel1_Callback(hObject, eventdata, handles)
% hObject    handle to etLabel1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

handles = storeNotes(handles);
guidata(hObject, handles);

% --- Executes during object creation, after setting all properties.
function etLabel1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to etLabel1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called


if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end

% --------------------------------------------------------------------
function mLoadFiles_Callback(hObject, eventdata, handles)
% hObject    handle to mLoadFiles (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
handles = loadFiles(handles);
guidata(hObject, handles);

% --------------------------------------------------------------------
function miLoadFiles_Callback(hObject, eventdata, handles)
% hObject    handle to miLoadFiles (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% --------------------------------------------------------------------
function mbExportNotes_Callback(hObject, eventdata, handles)
% hObject    handle to mbExportNotes (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)
handles = storeNotes(handles);
exportNotes(handles);
guidata(hObject, handles)

function etNotes1_Callback(hObject, eventdata, handles)
% hObject    handle to etNotes1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'String') returns contents of etNotes1 as text
%        str2double(get(hObject,'String')) returns contents of etNotes1 as a double
handles = storeNotes(handles);
guidata(hObject, handles);

% --- Executes during object creation, after setting all properties.
function etNotes1_CreateFcn(hObject, eventdata, handles)
% hObject    handle to etNotes1 (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: edit controls usually have a white background on Windows.
%       See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor','white');
end


% --- Executes on slider movement.
function slMin_Callback(hObject, eventdata, handles)
% hObject    handle to slMin (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider

handles = scaleSliderMin(handles);
guidata(hObject, handles);

% --- Executes during object creation, after setting all properties.
function slMin_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slMin (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end


% --- Executes on slider movement.
function slMax_Callback(hObject, eventdata, handles)
% hObject    handle to slMax (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    structure with handles and user data (see GUIDATA)

% Hints: get(hObject,'Value') returns position of slider
%        get(hObject,'Min') and get(hObject,'Max') to determine range of slider
handles = scaleSliderMax(handles);
guidata(hObject, handles);

% --- Executes during object creation, after setting all properties.
function slMax_CreateFcn(hObject, eventdata, handles)
% hObject    handle to slMax (see GCBO)
% eventdata  reserved - to be defined in a future version of MATLAB
% handles    empty - handles not created until after all CreateFcns called

% Hint: slider controls usually have a light gray background.
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
    set(hObject,'BackgroundColor',[.9 .9 .9]);
end

Contact us