Skip to content

Commit

Permalink
add via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
PAmcconnell authored Nov 12, 2019
0 parents commit 3a67aa7
Show file tree
Hide file tree
Showing 38 changed files with 7,986 additions and 0 deletions.
Binary file added ArtRepair.fig
Binary file not shown.
105 changes: 105 additions & 0 deletions ArtRepair.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
function varargout = spm_artifactrepair(varargin)
% SPM_ARTIFACTREPAIR M-file for spm_artifactrepair.fig
% SPM_ARTIFACTREPAIR, by itself, creates a new SPM_ARTIFACTREPAIR or raises the existing
% singleton*.
%
% H = SPM_ARTIFACTREPAIR returns the handle to a new SPM_ARTIFACTREPAIR or the handle to
% the existing singleton*.
%
% SPM_ARTIFACTREPAIR('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in SPM_ARTIFACTREPAIR.M with the given input arguments.
%
% SPM_ARTIFACTREPAIR('Property','Value',...) creates a new SPM_ARTIFACTREPAIR or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before spm_artifactrepair_OpeningFunction gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to spm_artifactrepair_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES

% Copyright 2002-2003 The MathWorks, Inc.

% Edit the above text to modify the response to help spm_artifactrepair

% Last Modified by GUIDE v2.5 26-Mar-2009 10:52:25

% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @spm_artifactrepair_OpeningFcn, ...
'gui_OutputFcn', @spm_artifactrepair_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 spm_artifactrepair is made visible.
function spm_artifactrepair_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 spm_artifactrepair (see VARARGIN)

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

% Update handles structure
guidata(hObject, handles);

% UIWAIT makes spm_artifactrepair wait for user response (see UIRESUME)
% uiwait(handles.figure1);


% --- Outputs from this function are returned to the command line.
function varargout = spm_artifactrepair_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 button press in pushbutton6.
function pushbutton6_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton6 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)


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


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


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


163 changes: 163 additions & 0 deletions aREADMEArtRepair_v5b3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
ART_REPAIR v5b3 (Sept. 2015)
Supports SPM12, but this beta version has not been thoroughly tested with it.

COMPATIBILITIES
SPM12, SPM8, SPM5, and backwards compatible to SPM2
Compatible with 3D nifti files, or AnalyzeFormat.
NOT compatible with 4D nifti files.

New features of v5b (Mar 2015, Aug 2015)
Supports SPM12
art_groupoutlier will run in Matlab without Statistics toolbox
art_motionstats, summarizes motion and rapid motion characteristics for a subject
art_motionstatsBatch, same as above for a cohort of subjects
v5b: Fixed bugs in art_despike and art_groupcheck (from Mike Schmitgen)
v5b1: Fixed bugs: Readme converted to .txt, Folder name changed, subfolder removed.
v5b1: Fixed bug for .nii compatibility in art_motionregress
v5b3: Fixed bugs for .nii compatibility in art_summary, art_groupcheck
v5b3: Fixed bugs for .nii compatibility in art_percentscale

New features of v4.1 (November 2012)
Upgrades to art_movie, with better display, larger capacity, more options
Upgrades to art_slice, to improve performance, and visually flag bad slices

Detailed changes
----------------
art_movie (from Dorian Pustina)
Can select mean image, or preceding image, as contrast reference
Display is automatically sized for the montage window
Size limit is expanded to handle many times more images
Fixed bugs in text sizing
art_slice (from Dorian Pustina)
Bad slices can be displayed in the contrast movie window
Uses spatial interpolation from neighboring slices to repair slices,
if the usual temporal interpolation would use a bad slice.
Wait bar added to the user interface


New features of v4 (June 2009)
It is named ArtRepair in the SPM toolbox window.
New art_motionregress, an alternative to using motion regressors
New art_despike, removes spikes and slow-varying background voxelwise
New art_rms, calculates image of rms variations of set of images
New art_plottimeseries, plots timeseries for a voxel

CHANGES from v2.2 (2007) are:
Same toolbox serves both SPM5 and SPM2.

Assumes that each session is realigned and repaired separately.
This approach is similar to SPM standard procedures,
and clinical subjects commonly move between sessions.
Previous version v2.2 assumed all sessions were realigned together.

New art_groupcheck to help a user validate group results
New art_groupoutlier program to identify outlier subjects
New art_groupsummary program to find GQ scores for a group result
New art_percentscale program to find percent scaling.
Documentation is on the ArtRepair website.

Updated art_global
User must now realign and repair each session separately.

Simplified art_redo. User must now repair and validate results manually.
Previously, the repair and compare functions were embedded,
which made the code brittle.

Improved reliability of scaling in art_movie; now mean image is 1000.

Fixed bug in art_summary in order to scale contrasts correctly

Removed art_batch programs, and art_deweightSPM program

BUG FIXES from v3
Add use deweight as default in art_redo
Improve functionality across SPM versions with strcmp command.


Detailed changes
----------------

art_motionregress
Estimates and removes interpolation artifacts before design estimation.
Fractional amount removed is greater at edges, less in center of brain.
Writes new images with prefix "m".
Use on realigned, resliced images.
Must use before normalization, else large images use huge memory.

art_despike
Clips spikes more extreme than a user-specified threshold, default=4%.
Option for two different high-pass filters, or an HRF matched filter
Despike and filter can be applied separately, or in combination.
Writes new images with prefix "d".
Must use before normalization, else large images use huge memory.

art_groupcheck
Allows user to review group results for contrasts and ResMS by voxel.
Allows user to review all contrasts for all subjects using a movie.
Allows user to find outlier subjects.
Scales contrasts into percent signal change for viewing.

art_groupsummary
Calculates Global Quality scores for a group result

art_groupoutlier
Compares Global Quality scores across subjects to find outlier subjects.
Suggests good subgroups to use.

art_percentscale
Calculates scale factors to convert results into percent signal change,
as described in the document FMRIPercentSignalChange.

art_global
User should realign and repair each session separately.
Global intensity threshold varies more as motion threshold is changed.
Global intensity threshold is linked to adaptive motion threshold.

art_activationmap3
The colormap used in art_groupcheck to display the contrast images.

art_redo
User must repair scans first, each session repaired separately.
Program will apply deweighting, and estimate results for repaired files.
Program will write a new SPM.mat file to a new results folder.
User must compare results, before and after, with Global Quality.
(The previously used embedded functionality in v2.2 was brittle.)

art_movie
Fixed bug that caused movie frame to shift (from Volkmar Glauche).
Image intensities are now scaled so that mean of image is 1000,
which means that scale value of 160 is exactly 16% signal change.
Previously scaling was based on peak intensity, so output values
were not as reliable.

art_summary
Scales Global Quality for contrasts by the sum of the positive terms of
the contrast vector c. Previously it was the RMS norm of c.


NOTES for v2.2 (Aug. 2007)
spm_ArtRepair2 or spm_ArtRepair5
Menu opens in SPM Interactive Window
with same menu format as many other Toolbox programs..
This change makes menu compatible with Matlab 6.5.1.
(Old style menu is available as: >> old_ArtRepair5)

art_global
Also marks scan BEFORE large movement for repair.
Before it only marked the scan after.

Allows RepairType = 2 to not add margin in automatic mode
(planning for compatibility with motion regressors).

Add "Clip" button to mark all movements larger than 3 mm.

Fixed logic bug for case when user applies his own mask.

art_redo
Changed logic to redo an i.i.d. design as an i.i.d design.
Previously, i.i.d. became AR(0.2) from an interaction bug with SPM.

Automatically scales for peak of design regressor, and
norm of the contrast vector.


87 changes: 87 additions & 0 deletions art_activationmap3.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
function ymap = art_activationmap3(i)
% Make a 64 element colormap- hot colors > 32, cold colors < 32.
% green -> blue -> black -> red -> yellow
% Used for art_groupcheck program.
% Paul Mazaika Oct 2007. (no change for v.2).
xmap = [

0.0250 0 0
0.0500 0 0
0.0750 0 0
0.1000 0 0
0.1250 0 0
0.1500 0 0
0.1750 0 0
0.2000 0 0
0.2250 0 0
0.2500 0 0
0.2750 0 0
0.3000 0 0
0.3250 0.0192 0
0.3500 0.0385 0
0.3750 0.0577 0
0.4000 0.0769 0
0.4250 0.0962 0
0.4500 0.1154 0
0.4750 0.1346 0
0.5000 0.1538 0
0.5250 0.1731 0
0.5500 0.1923 0
0.5750 0.2115 0
0.6000 0.2308 0
0.6250 0.2500 0
0.6500 0.2692 0
0.6750 0.2885 0
0.7000 0.3077 0
0.7250 0.3269 0
0.7500 0.3462 0
0.7750 0.3654 0
0.8000 0.3846 0
0.8250 0.4038 0
0.8500 0.4231 0
0.8750 0.4423 0
0.9000 0.4615 0
0.9250 0.4808 0
0.9500 0.5000 0
0.9750 0.5192 0
1.0000 0.5385 0
1.0000 0.5577 0
1.0000 0.5769 0
1.0000 0.5962 0
1.0000 0.6154 0
1.0000 0.6346 0
1.0000 0.6538 0
1.0000 0.6731 0
1.0000 0.6923 0
1.0000 0.7115 0
1.0000 0.7308 0
1.0000 0.7500 0
1.0000 0.7692 0
1.0000 0.7885 0
1.0000 0.8077 0
1.0000 0.8269 0
1.0000 0.8462 0
1.0000 0.8654 0
1.0000 0.8846 0
1.0000 0.9038 0
1.0000 0.9231 0
1.0000 0.9423 0
1.0000 0.9615 0
1.0000 0.9808 0
1.0000 1.0000 0
];

size(xmap); % 64x3
ymap = zeros(64,3);
for i = 1:32
ymap(32+i,:) = 0.9*xmap(2*i,:)+0.1;
ymap(32+i,2) = 0.9*xmap(max(round(1.2*(2*i-12)),1),2)+0.1;
ymap(33-i,2) = 0.9*xmap(2*i,2)+0.1;
ymap(33-i,1) = 0.9*xmap(2*i,3)+0.1;
ymap(33-i,3) = 0.9*xmap(2*i,1)+0.1;
ymap(32:33,1:3) = 0; % set outside of mask to black
end
for i = 1:12 % roll off blue and warm up red to expose green color
ymap(i,3) = ymap(13-i,2);
ymap(i,1) = 0.2*(ymap(i,2) - .5);
end
Loading

0 comments on commit 3a67aa7

Please sign in to comment.