Skip to content

Commit

Permalink
Merge pull request #497 from schorschinho/develop
Browse files Browse the repository at this point in the history
Release Push v.2.4.0
  • Loading branch information
HJZollner authored Aug 4, 2022
2 parents 7c9d2ef + cfb0196 commit 514cff2
Show file tree
Hide file tree
Showing 85 changed files with 58,884 additions and 476 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','2.3.0','Date', 'June 24, 2022',...
gui.d = uiw.dialog.About('Name', 'Osprey','Version','2.4.0','Date', 'August 8, 2022',...
'Timeout', 3,'CustomText', 'Osprey is provided by Johns Hopkins University.',...
'ContactInfo', '[email protected]','LogoCData', logoBanner);

Expand Down
2 changes: 1 addition & 1 deletion GUI/osp_Toolbox_Check.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
% 2020-05-15: First version of the code.
%% % 1. SAVE OSPREY VERSION%%%
%%% 1. SAVE OSPREY VERSION%%%
OspreyVersion = 'Osprey 2.3.0';
OspreyVersion = 'Osprey 2.4.0';
fprintf(['Timestamp %s ' OspreyVersion ' ' Module '\n'], datestr(now,'mmmm dd, yyyy HH:MM:SS'));
hasSPM = 1; % For the compiled GUI
%% % 2. GET SPMPATH AND TOOLBOXES%%%
Expand Down
6 changes: 3 additions & 3 deletions GUI/osp_onPrint.m
Original file line number Diff line number Diff line change
Expand Up @@ -376,15 +376,15 @@ function osp_onPrint( ~, ~ ,gui)
waterFitRangeString = ['Fitting range: ' num2str(MRSCont.opts.fit.rangeWater(1)) ' to ' num2str(MRSCont.opts.fit.rangeWater(2)) ' ppm'];
% Where are the metabolite names stored?
if strcmp(gui.fit.Style, 'ref') || strcmp(gui.fit.Style, 'w')
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(MRSCont.processed.metab{gui.controls.Selected}.sz(1)) '_' num2str(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth)]){1};
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.sz(1))) '_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth))]){1};
basisSetNames = basisSet.name;
subSpecName = gui.fit.Style;
else if strcmp(gui.fit.Style, 'conc')
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(MRSCont.processed.metab{gui.controls.Selected}.sz(1)) '_' num2str(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth)]){basis,1};
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.sz(1))) '_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth))]){basis,1};
basisSetNames = basisSet.name;
subSpecName = basisSet.names{1};
else
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(MRSCont.processed.metab{gui.controls.Selected}.sz(1)) '_' num2str(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth)]){basis,1,subspectrum};
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.sz(1))) '_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth))]){basis,1,subspectrum};
basisSetNames = basisSet.name;
subSpecName = basisSet.names{1};
end
Expand Down
6 changes: 3 additions & 3 deletions GUI/osp_updateFitWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@ function osp_updateFitWindow(gui)
waterFitRangeString = ['Fitting range: ' num2str(MRSCont.opts.fit.rangeWater(1)) ' to ' num2str(MRSCont.opts.fit.rangeWater(2)) ' ppm'];
% Where are the metabolite names stored?
if strcmp(gui.fit.Style, 'ref') || strcmp(gui.fit.Style, 'w')
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(MRSCont.processed.metab{gui.controls.Selected}.sz(1)) '_' num2str(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth)]){1};
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.sz(1))) '_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth))]){1};
basisSetNames = basisSet.name;
else if strcmp(gui.fit.Style, 'conc')
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(MRSCont.processed.metab{gui.controls.Selected}.sz(1)) '_' num2str(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth)]){basis,1};
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.sz(1))) '_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth))]){basis,1};
basisSetNames = basisSet.name;
else
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(MRSCont.processed.metab{gui.controls.Selected}.sz(1)) '_' num2str(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth)]){basis,1,subspectrum};
basisSet = MRSCont.fit.resBasisSet.(gui.fit.Style).(['np_sw_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.sz(1))) '_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth))]){basis,1,subspectrum};
basisSetNames = basisSet.name;
end
end
Expand Down
6 changes: 5 additions & 1 deletion GUI/osp_updateLoadWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,11 @@ function osp_updateLoadWindow(gui)
set(ViewAxes.Children, 'Parent', gui.Plot.data{gui.load.Selected}.Children);
set(gui.Plot.data{gui.load.Selected}.Children.Title, 'String', ViewAxes.Title.String);
set(gui.Plot.data{gui.load.Selected}.Children, 'XLim',ViewAxes.XLim);
set(gui.upperBox.data.Info{gui.load.Selected},'Title', ['Actual file: ' MRSCont.files_ref{Exp,gui.controls.Selected}] );
if ~isempty(MRSCont.files_ref)
set(gui.upperBox.data.Info{gui.load.Selected},'Title', ['Actual file: ' MRSCont.files_ref{Exp,gui.controls.Selected}] );
else
set(gui.upperBox.data.Info{gui.load.Selected},'Title', ['Actual file: ' MRSCont.files{Exp,gui.controls.Selected}] );
end
case 'MM reference'
if Exp > max(MRSCont.opts.MultipleSpectra.mm_ref)
Exp = 1;
Expand Down
2 changes: 1 addition & 1 deletion GUI/osp_updateQuantifyWindow.m
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function osp_updateQuantifyWindow(gui)
%%% 1. INITIALIZE %%%
MRSCont = getappdata(gui.figure,'MRSCont'); % Get MRSCont from hidden container in gui class
gui.layout.EmptyQuantPlot = 0;
basisSet = MRSCont.fit.resBasisSet.metab.(['np_sw_' num2str(MRSCont.processed.metab{gui.controls.Selected}.sz(1)) '_' num2str(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth)]){gui.controls.act_z,1,gui.controls.act_y};
basisSet = MRSCont.fit.resBasisSet.metab.(['np_sw_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.sz(1))) '_' num2str(round(MRSCont.processed.metab{gui.controls.Selected}.spectralwidth))]){gui.controls.act_z,1,gui.controls.act_y};
subSpecName = basisSet.names{1};
if ~(isfield(MRSCont.flags,'isPRIAM') || isfield(MRSCont.flags,'isMRSI')) || ~(MRSCont.flags.isPRIAM || MRSCont.flags.isMRSI)
gui.upperBox.quant.Info = gui.layout.(gui.layout.quantifyTabhandles{gui.quant.Selected.Model}).Children(2).Children(1);
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,11 @@ Should you publish material that made use of Osprey, please cite the following p

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
We wish to thank collaborators and partners for providing LCModel basis sets and control files. If you use these resources for your analysis of the following data types, please mention the respective individuals in your acknowledgements:
- Siemens 7T STEAM (TE = 5 ms): Dr. Dinesh Deelchand (University of Minnesota)
- Siemens 3T and 7T SPECIAL (TE = 8.5/9 ms): Dr. Ariane Fillmer (PTB Berlin)

We also wish to thank the following individuals for their contributions to the
development of Osprey and shared processing code:

- Jamie Near (McGill University, Montreal)
Expand Down
21 changes: 0 additions & 21 deletions ci/UnitTest.m
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,6 @@
rt{2} = table(results{2});
end

dir = strrep(which(['ci' filesep 'job' sequence '.m']),['job' sequence '.m'],['rawdata_CI' filesep 'sub-01' filesep 'anat']);
delete(fullfile(dir,'c1sub-01_T1w.nii.gz'));
delete(fullfile(dir,'c2sub-01_T1w.nii.gz'));
delete(fullfile(dir,'c3sub-01_T1w.nii.gz'));
delete(fullfile(dir,'sub-01_T1w.nii'));
delete(fullfile(dir,'sub-01_T1w_seg8.mat'));

dir = strrep(which(['ci' filesep 'job' sequence '.m']),['job' sequence '.m'],['rawdata_CI' filesep 'sub-02' filesep 'anat']);
delete(fullfile(dir,'c1sub-02_T1w.nii.gz'));
delete(fullfile(dir,'c2sub-02_T1w.nii.gz'));
delete(fullfile(dir,'c3sub-02_T1w.nii.gz'));
delete(fullfile(dir,'sub-02_T1w.nii'));
delete(fullfile(dir,'sub-02_T1w_seg8.mat'));

dir = strrep(which(['ci' filesep 'job' sequence '.m']),['job' sequence '.m'],'derivatives');
rmdir(dir,'s')

Expand All @@ -82,13 +68,6 @@
results{2} = runtests('Osprey_Plot_GUI_test.m');
rt{2} = table(results{2});

dir = strrep(which(['ci' filesep 'job' sequence '.m']),['job' sequence '.m'],['rawdata_CI' filesep 'sub-01' filesep 'anat']);
delete(fullfile(dir,'c1sub-01_T1w.nii.gz'));
delete(fullfile(dir,'c2sub-01_T1w.nii.gz'));
delete(fullfile(dir,'c3sub-01_T1w.nii.gz'));
delete(fullfile(dir,'sub-01_T1w.nii'));
delete(fullfile(dir,'sub-01_T1w_seg8.mat'));

dir = strrep(which(['ci' filesep 'job' sequence '.m']),['job' sequence '.m'],'derivatives');
rmdir(dir,'s')
end
Expand Down
2 changes: 1 addition & 1 deletion ci/azure-pipelines-develop-pull.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Pull request CI pipeline for Osprey
# Triggers for each pull request into the develop branch
# Triggers for each pull request into the develop branch
# Starts with a quick Single Subject PRESS test
# If the first stage is successful a Full PRESS job is triggered

Expand Down
19 changes: 18 additions & 1 deletion coreg/OspreyCoreg.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,17 @@
% Checking for version, toolbox, and previously run modules
[~,MRSCont.ver.CheckOsp ] = osp_CheckRunPreviousModule(MRSCont, 'OspreyCoreg');

%Do some check on the naming convention first to avoid overwriting the
%output due to non BIDS conform data names
SameName = 0;
if MRSCont.nDatasets(1) > 1
specFile = MRSCont.files{1};
specFile2 = MRSCont.files{2};
[~, SpecName, ~] = fileparts(specFile);
[~, SpecName2, ~] = fileparts(specFile2);
SameName = strcmp(SpecName,SpecName2);
end
MRSCont.coreg.SameName = SameName;

% Set up saving location
saveDestination = fullfile(MRSCont.outputFolder, 'VoxelMasks'); %CWDJ - Address in future update
Expand All @@ -55,14 +66,20 @@
for kk = 1:MRSCont.nDatasets(1)
[~] = printLog('OspreyCoreg',kk,1,MRSCont.nDatasets,progressText,MRSCont.flags.isGUI ,MRSCont.flags.isMRSI);
if ~(MRSCont.flags.didCoreg == 1 && MRSCont.flags.speedUp && isfield(MRSCont, 'coreg') && (kk > length(MRSCont.coreg.vol_image))) || ~strcmp(MRSCont.ver.Osp,MRSCont.ver.CheckOsp)

if SameName
[PreFix] = osp_generate_SubjectAndSessionPrefix(MRSCont.files{kk},kk);
else
PreFix = '';
end

% Get the input file name
[~,filename,~] = fileparts(MRSCont.files{kk});
% Get the nii file name
[~,~,T1ext] = fileparts(MRSCont.files_nii{kk});

%<source_entities>[_space-<space>][_res-<label>][_den-<label>][_label-<label>][_desc-<label>]_mask.nii.gz
saveName = [osp_RemoveSuffix(filename),'_space-scanner']; %CWDJ Check space.
saveName = [PreFix '_' filename '_space-scanner']; %CWDJ Check space.

% Generate file name for the voxel mask NIfTI file to be saved under
maskFile = fullfile(saveDestination, [saveName '_mask.nii']);
Expand Down
10 changes: 5 additions & 5 deletions coreg/coreg_ge_nifti.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@

%%% 2. PREPARE THE MRS VOXEL COORDINATES %%%
% Convert from RAS to LPS
VoxOffs = geom.pos .* [-1 1 1];
tlhc_LPS = geom.rot.tlhc .* [-1 1 1];
trhc_LPS = geom.rot.trhc .* [-1 1 1];
brhc_LPS = geom.rot.brhc .* [-1 1 1];
VoxOffs = geom.pos .* [1 1 1];
tlhc_LPS = geom.rot.tlhc .* [1 1 1];
trhc_LPS = geom.rot.trhc .* [1 1 1];
brhc_LPS = geom.rot.brhc .* [1 1 1];

e1_SVS_n = trhc_LPS - tlhc_LPS;
e1_SVS_n = e1_SVS_n ./ norm(e1_SVS_n);
Expand Down Expand Up @@ -132,7 +132,7 @@

mask(mrs_box_ind) = 1;

%mask = flip(mask,2);
% mask = flip(mask,1);

% Fill in the SPM volume header information
vol_mask.fname = maskFile;
Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion exampledata/sdat/MEGA/jobSDAT_MEGA.m
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@
% (OPTIONAL)
% Link to single NIfTI (*.nii) files for Siemens and Philips data
% Link to DICOM (*.dcm) folders for GE data
files_nii(counter) = {[sess(ll).folder filesep sess(ll).name filesep 'anat' filesep subs(kk).name filesep sess(ll).name '_T1w.nii.gz']};
files_nii(counter) = {[sess(ll).folder filesep sess(ll).name filesep 'anat' filesep subs(kk).name filesep subs(kk).name '_' sess(ll).name '_T1w.nii.gz']};

% External segmentation results
% (OPTIONAL)
Expand Down
2 changes: 1 addition & 1 deletion exampledata/sdat/MEGA/jobSDAT_MEGA_Multidataset.m
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
% (OPTIONAL)
% Link to single NIfTI (*.nii) files for Siemens and Philips data
% Link to DICOM (*.dcm) folders for GE data
files_nii(counter) = {[sess(ll).folder filesep sess(ll).name filesep 'anat' filesep subs(kk).name filesep sess(ll).name '_T1w.nii.gz']};
files_nii(counter) = {[sess(ll).folder filesep sess(ll).name filesep 'anat' filesep subs(kk).name filesep subs(kk).name '_' sess(ll).name '_T1w.nii.gz']};

% External segmentation results
% (OPTIONAL)
Expand Down
2 changes: 1 addition & 1 deletion exampledata/sdat/UnEdited/jobSDAT.m
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@
% (OPTIONAL)
% Link to single NIfTI (*.nii) files for Siemens and Philips data
% Link to DICOM (*.dcm) folders for GE data
files_nii(counter) = {[sess(ll).folder filesep sess(ll).name filesep 'anat' filesep subs(kk).name filesep sess(ll).name '_T1w.nii.gz']};
files_nii(counter) = {[sess(ll).folder filesep sess(ll).name filesep 'anat' filesep subs(kk).name filesep subs(kk).name '_' sess(ll).name '_T1w.nii.gz']};

% External segmentation results
% (OPTIONAL)
Expand Down
2 changes: 1 addition & 1 deletion exampledata/sdat/UnEdited/jobSDAT_LCModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
% (OPTIONAL)
% Link to single NIfTI (*.nii) files for Siemens and Philips data
% Link to DICOM (*.dcm) folders for GE data
files_nii(counter) = {[sess(ll).folder filesep sess(ll).name filesep 'anat' filesep subs(kk).name filesep sess(ll).name '_T1w.nii.gz']};
files_nii(counter) = {[sess(ll).folder filesep sess(ll).name filesep 'anat' filesep subs(kk).name filesep subs(kk).name '_' sess(ll).name '_T1w.nii.gz']};

% External segmentation results
% (OPTIONAL)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading

0 comments on commit 514cff2

Please sign in to comment.