Skip to content

Commit

Permalink
Merge pull request #399 from schorschinho/develop
Browse files Browse the repository at this point in the history
Prepare release v2.1.0
  • Loading branch information
HJZollner authored Apr 29, 2022
2 parents 39a7c51 + 4eef5c3 commit 998aeda
Show file tree
Hide file tree
Showing 90 changed files with 754 additions and 310 deletions.
2 changes: 1 addition & 1 deletion GUI/Osprey.m
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
logoFcn = @()imread('osprey.png', 'BackgroundColor', gui.colormap.Background);
logoBanner = uiw.utility.loadIcon(logoFcn);
% Here the intro banner is created
gui.d = uiw.dialog.About('Name', 'Osprey','Version','1.0.0','Date', 'October 6, 2019',...
gui.d = uiw.dialog.About('Name', 'Osprey','Version','2.0.0','Date', 'April 12, 2022',...
'Timeout', 3,'CustomText', 'Osprey is provided by Johns Hopkins University.',...
'ContactInfo', '[email protected]','LogoCData', logoBanner);

Expand Down
10 changes: 7 additions & 3 deletions GUI/OspreyGUI.m
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
end
else
gui.controls.nDatasets = 0;
gui.controls.nExperiments = 1;
end

%Setting up remaining values in dependence of the conducted processing steps
Expand Down Expand Up @@ -331,9 +332,12 @@
% Load button
gui.layout.b_load = uicontrol('Parent', gui.layout.p2,'Style','PushButton','String','Load data','Enable','on','ForegroundColor', gui.colormap.Foreground);
set(gui.layout.b_load,'Units','Normalized','Position',[0.1 0.75 0.8 0.08], 'FontSize', 16, 'FontName', gui.font, 'FontWeight', 'Bold','Tag','LoadButton');
sz_raw = size(MRSCont.raw);
if (MRSCont.flags.didLoadData == 1 && isfield(MRSCont, 'raw') && (gui.controls.nDatasets(1) >= sz_raw(end)))
gui.layout.b_load.Enable = 'off';

if (MRSCont.flags.didLoadData == 1 && isfield(MRSCont, 'raw'))
sz_raw = size(MRSCont.raw);
if (gui.controls.nDatasets(1) >= sz_raw(end))
gui.layout.b_load.Enable = 'off';
end
end
set(gui.layout.b_load,'Callback',{@osp_onLoad,gui}, 'TooltipString', 'Call OspreyLoad');
set(gui.layout.b_load,'Tag','Load');
Expand Down
20 changes: 10 additions & 10 deletions GUI/osp_iniLoadWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ function osp_iniLoadWindow(gui)
case 'metabolites'
temp = osp_plotLoad(MRSCont, gui.controls.Selected,'mets');
if MRSCont.flags.isUnEdited % One window for UnEdited
ViewAxes = gca();
set( ViewAxes, 'Parent', gui.Plot.data{t} );
drawnow
set( temp.Children, 'Parent', gui.Plot.data{t} );
end
if MRSCont.flags.isMEGA %Two windows for MEGA
set( temp.Children(2), 'Parent', gui.Plot.data{t} );
Expand Down Expand Up @@ -387,8 +387,8 @@ function osp_iniLoadWindow(gui)
case 'MM'
temp = osp_plotLoad(MRSCont, gui.controls.Selected,'mm');
if MRSCont.flags.isUnEdited % One window for UnEdited
ViewAxes = gca();
set( ViewAxes, 'Parent', gui.Plot.data{t} );
drawnow
set( temp.Children, 'Parent', gui.Plot.data{t} );
end
if MRSCont.flags.isMEGA %Two windows for MEGA
set( temp.Children(2), 'Parent', gui.Plot.data{t} );
Expand Down Expand Up @@ -423,16 +423,16 @@ function osp_iniLoadWindow(gui)
end
case 'reference'
temp = osp_plotLoad(MRSCont, gui.controls.Selected,'ref'); %re_mm
ViewAxes = gca(); %re_mm
set( ViewAxes, 'Parent', gui.Plot.data{t} ); %re_mm
drawnow
set( temp.Children, 'Parent', gui.Plot.data{t} ); %re_mm
case 'MM reference'
temp = osp_plotLoad(MRSCont, gui.controls.Selected,'mm_ref'); %re_mm
ViewAxes = gca(); %re_mm
set( ViewAxes, 'Parent', gui.Plot.data{t} ); %re_mm
drawnow
set( temp.Children, 'Parent', gui.Plot.data{t} ); %re_mm
case 'water'
temp = osp_plotLoad(MRSCont, gui.controls.Selected,'w'); %re_mm
ViewAxes = gca(); %re_mm
set( ViewAxes, 'Parent', gui.Plot.data{t} ); %re_mm
drawnow
set(temp.Children, 'Parent', gui.Plot.data{t} ); %re_mm
end


Expand Down
20 changes: 10 additions & 10 deletions GUI/osp_onPrint.m
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ function osp_onPrint( ~, ~ ,gui)
end
outputFile = [filename '_Voxel_' num2str(VoxelIndex) '_Exp_' num2str(Exp) '_OspreyLoad_mets.pdf'];
if MRSCont.flags.isUnEdited % One window for UnEdited
ViewAxes = gca();
set( ViewAxes, 'Parent', Plot );
drawnow
set( temp.Children, 'Parent', Plot );
end
if MRSCont.flags.isMEGA %Two windows for MEGA
set( temp.Children(2), 'Parent', Plot );
Expand Down Expand Up @@ -172,8 +172,8 @@ function osp_onPrint( ~, ~ ,gui)
end
outputFile = [filename '_Voxel_' num2str(VoxelIndex) '_Exp_' num2str(Exp) '_OspreyLoad_MM.pdf'];
if MRSCont.flags.isUnEdited % One window for UnEdited
ViewAxes = gca();
set( ViewAxes, 'Parent', Plot );
drawnow
set( temp.Children, 'Parent', Plot );
end
if MRSCont.flags.isMEGA %Two windows for MEGA
set( temp.Children(2), 'Parent', Plot );
Expand Down Expand Up @@ -220,8 +220,8 @@ function osp_onPrint( ~, ~ ,gui)
else
temp = osp_plotLoad(MRSCont, gui.controls.Selected,'ref',Exp,[gui.controls.act_x gui.controls.act_y gui.controls.act_z]);
end
ViewAxes = gca(); %re_mm
set( ViewAxes, 'Parent', Plot );
drawnow
set( temp.Children, 'Parent', Plot );
outputFile = [filename '_Voxel_' num2str(VoxelIndex) '_Exp_' num2str(Exp) '_OspreyLoad_ref.pdf'];

case 'MM reference'
Expand All @@ -238,8 +238,8 @@ function osp_onPrint( ~, ~ ,gui)
else
temp = osp_plotLoad(MRSCont, gui.controls.Selected,'mm_ref',Exp,[gui.controls.act_x gui.controls.act_y gui.controls.act_z]);
end
ViewAxes = gca(); %re_mm
set( ViewAxes, 'Parent', Plot );
drawnow
set( temp.Children, 'Parent', Plot );
outputFile = [filename '_Voxel_' num2str(VoxelIndex) '_Exp_' num2str(Exp) '_OspreyLoad_mm_ref.pdf'];

case 'water'
Expand All @@ -256,8 +256,8 @@ function osp_onPrint( ~, ~ ,gui)
else
temp = osp_plotLoad(MRSCont, gui.controls.Selected,'w',Exp,[gui.controls.act_x gui.controls.act_y gui.controls.act_z]);
end
ViewAxes = gca(); %re_mm
set( ViewAxes, 'Parent', Plot );
drawnow
set( temp.Children, 'Parent', Plot );
outputFile = [filename '_Voxel_' num2str(VoxelIndex) '_Exp_' num2str(Exp) '_OspreyLoad_w.pdf'];
end
set(input_figure, 'Heights', [-0.1 -0.9]);
Expand Down
8 changes: 4 additions & 4 deletions GUI/osp_onQuant.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ function osp_onQuant( ~, ~ ,gui)
gui.quant.Names.Model = fieldnames(MRSCont.quantify.tables);
gui.quant.Number.Quants = length(fieldnames(MRSCont.quantify.tables.(gui.quant.Names.Model{1})));
gui.quant.Names.Quants = fieldnames(MRSCont.quantify.tables.(gui.quant.Names.Model{1}));
gui.quant.Number.Metabs = length(MRSCont.quantify.metabs);
gui.overview.Selected.Metab = find(strcmp(MRSCont.quantify.metabs.(gui.quant.Names.Model{1}), 'tNAA'));
gui.quant.Number.Metabs = length(MRSCont.quantify.names.(gui.quant.Names.Model{1}));
gui.overview.Selected.Metab = find(strcmp(MRSCont.quantify.names.(gui.quant.Names.Model{1}){1,1}, 'tNAA'));
if isempty(gui.overview.Selected.Metab)
gui.overview.Selected.Metab = find(strcmp(MRSCont.quantify.metabs.(gui.quant.Names.Model{1}), 'NAA'));
gui.overview.Selected.Metab = find(strcmp(MRSCont.quantify.names.(gui.quant.Names.Model{1}){1,1}, 'NAA'));
end
gui.quant.idx.GABA = find(strcmp(MRSCont.quantify.metabs, 'GABA'));
gui.quant.idx.GABA = find(strcmp(MRSCont.quantify.names.(gui.quant.Names.Model{1}){1,1}, 'GABA'));
setappdata(gui.figure,'MRSCont',MRSCont); % Write MRSCont into hidden container in gui class
%%% 3. INITIALIZE QUANTIFY OUTPUT WINDOW %%%
MRSCont = OspreyOverview(MRSCont);
Expand Down
18 changes: 9 additions & 9 deletions GUI/osp_updateCoregWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,14 @@ function osp_updateCoregWindow(gui)
set(gui.upperBox.coreg.Info.Children, 'String',sprintf(StatText))
%%% 3. VISUALIZATION PART OF THIS TAB %%%
if MRSCont.flags.didSeg && length(gui.Results.coreg.Children) == 2 %Did seg & has been visualized already
delete( gui.Results.coreg.Children(1) ); %delete seg contents
delete( gui.Results.coreg.Children(1) ); %delete coreg contents
temp = figure( 'Visible', 'off' );
if ~isfield(MRSCont.flags,'isPRIAM') && ~MRSCont.flags.isPRIAM
temp = osp_plotCoreg(MRSCont, gui.controls.Selected);
else
temp = osp_plotCoreg(MRSCont, gui.controls.Selected,gui.controls.act_x);
end
set( temp.Children, 'Parent', gui.Results.coreg);
set( temp.Children.Children, 'Parent', gui.Results.coreg.Children(2));
delete( gui.Results.coreg.Children(2).Children(2) );
colormap(gui.Results.coreg.Children(1),'gray');
close( temp );
temp = figure( 'Visible', 'off' );
Expand All @@ -58,19 +57,20 @@ function osp_updateCoregWindow(gui)
else
temp = osp_plotSegment(MRSCont, gui.controls.Selected,gui.controls.act_x);
end
set( temp.Children, 'Parent', gui.Results.coreg );
set( temp.Children.Children, 'Parent', gui.Results.coreg.Children(1));
delete( gui.Results.coreg.Children(1).Children(10:end));
set(gui.Results.coreg.Children(1),'Children',flipud(gui.Results.coreg.Children(1).Children));
colormap(gui.Results.coreg.Children(1),'gray');
close( temp );
end
else if MRSCont.flags.didSeg && length(gui.Results.coreg.Children) == 1 %Did seg but has not been visualized yet (Initial run of segement button)
delete( gui.Results.coreg.Children(1) );
temp = figure( 'Visible', 'off' );
if ~isfield(MRSCont.flags,'isPRIAM') && ~MRSCont.flags.isPRIAM
temp = osp_plotCoreg(MRSCont, gui.controls.Selected);
else
temp = osp_plotCoreg(MRSCont, gui.controls.Selected,gui.controls.act_x);
end
set( temp.Children, 'Parent', gui.Results.coreg);
set( temp.Children.Children, 'Parent', gui.Results.coreg.Children(1));
colormap(gui.Results.coreg.Children(1),'gray');
close( temp );
temp = figure( 'Visible', 'off' );
Expand All @@ -79,7 +79,7 @@ function osp_updateCoregWindow(gui)
else
temp = osp_plotSegment(MRSCont, gui.controls.Selected,gui.controls.act_x);
end
set( temp.Children, 'Parent', gui.Results.coreg );
set( temp.Children.Children, 'Parent', gui.Results.coreg.Children(2));
colormap(gui.Results.coreg.Children(1),'gray');
close( temp );
else if length(gui.Results.coreg.Children) == 1 %Only coreg has been performed
Expand All @@ -89,8 +89,8 @@ function osp_updateCoregWindow(gui)
else
temp = osp_plotCoreg(MRSCont, gui.controls.Selected,gui.controls.act_x);
end
delete( gui.Results.coreg.Children(1) );
set( temp.Children, 'Parent', gui.Results.coreg );
set( temp.Children.Children, 'Parent', gui.Results.coreg.Children(1) );
delete( gui.Results.coreg.Children(1).Children(2) );
colormap(gui.Results.coreg.Children,'gray')
close( temp );
else % Neither coreg nor segment has been performed
Expand Down
2 changes: 1 addition & 1 deletion GUI/osp_updateFitWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function osp_updateFitWindow(gui)
if MRSCont.flags.hasRef %Calculate Raw Water Scaled amplitudes
RawAmpl = RawAmpl ./ (MRSCont.fit.results.ref.fitParams{1,gui.controls.Selected}.ampl .* MRSCont.fit.scale{gui.controls.Selected});
else
RawAmpl = RawAmpl ./ (MRSCont.fit.results.water.fitParams{1,gui.controls.Selected}.ampl .* MRSCont.fit.scale{gui.controls.Selected});
RawAmpl = RawAmpl ./ (MRSCont.fit.results.w.fitParams{1,gui.controls.Selected}.ampl .* MRSCont.fit.scale{gui.controls.Selected});
end
case 'LCModel'
end
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Should you publish material that made use of Osprey, please cite the following p

## Acknowledgements

This work has been supported by NIH grants R01EB016089, P41EB15909, R01EB023963, and K99AG062230.
This work has been supported by NIH grants R01 EB016089, P41 EB15909, P41 EB031771, R01 EB023963, and K99 AG062230.

We wish to thank the following individuals for their contributions to the
development of Osprey and shared processing code:
Expand Down
6 changes: 3 additions & 3 deletions ci/Osprey_Plot_GUI_test.m
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,17 @@ function testOspreyGUI(~)
if MRSCont.flags.isUnEdited
osp_plotModule(MRSCont, 'OspreyRaincloudOverview', 1, [1 1], 'metab-A-tCr', 'tNAA');
osp_plotModule(MRSCont, 'OspreyRaincloudOverview', 1, [1 1], 'metab-A-tCr', 'tCho');
osp_plotModule(MRSCont, 'OspreyRaincloudOverview', 1, [1 1], 'metab-A-tCr', 'Ins');
osp_plotModule(MRSCont, 'OspreyRaincloudOverview', 1, [1 1], 'metab-A-tCr', 'mI');
osp_plotModule(MRSCont, 'OspreyRaincloudOverview', 1, [1 1], 'metab-A-tCr', 'Glx');

osp_plotModule(MRSCont, 'OspreyScatterOverview', 1, [1 1], 'metab-A-tCr', 'tNAA', 'SNR');
osp_plotModule(MRSCont, 'OspreyScatterOverview', 1, [1 1], 'metab-A-tCr', 'tCho', 'SNR');
osp_plotModule(MRSCont, 'OspreyScatterOverview', 1, [1 1], 'metab-A-tCr', 'Ins', 'SNR');
osp_plotModule(MRSCont, 'OspreyScatterOverview', 1, [1 1], 'metab-A-tCr', 'mI', 'SNR');
osp_plotModule(MRSCont, 'OspreyScatterOverview', 1, [1 1], 'metab-A-tCr', 'Glx', 'SNR');

osp_plotModule(MRSCont, 'OspreyScatterOverview', 1, [1 1], 'metab-A-tCr', 'tNAA', 'FWHM');
osp_plotModule(MRSCont, 'OspreyScatterOverview', 1, [1 1], 'metab-A-tCr', 'tCho', 'FWHM');
osp_plotModule(MRSCont, 'OspreyScatterOverview', 1, [1 1], 'metab-A-tCr', 'Ins', 'FWHM');
osp_plotModule(MRSCont, 'OspreyScatterOverview', 1, [1 1], 'metab-A-tCr', 'mI', 'FWHM');
osp_plotModule(MRSCont, 'OspreyScatterOverview', 1, [1 1], 'metab-A-tCr', 'Glx', 'FWHM');
end
if MRSCont.flags.isMEGA
Expand Down
Loading

0 comments on commit 998aeda

Please sign in to comment.