Giter Site home page Giter Site logo

vistalab / vistasoft Goto Github PK

View Code? Open in Web Editor NEW
147.0 50.0 142.0 150.62 MB

VISTASOFT is the main software repository of the VISTA lab at Stanford University.

Home Page: http://vistalab.stanford.edu

MATLAB 85.74% M 0.66% C 6.40% Shell 0.31% Makefile 0.01% C++ 4.51% Mercury 0.01% HTML 1.88% CSS 0.02% JavaScript 0.11% Objective-C 0.01% TeX 0.07% Python 0.01% Mathematica 0.28%

vistasoft's Introduction

Vistasoft

VISTASOFT is the main software repository of the Vista lab at Stanford University. It contains Matlab code to perform a variety of analysis on MRI data, including functional MRI and diffusion MRI.

License

(c) Vista lab, Stanford University.

Unless otherwise noted, all our code is released under the GPL

Modules

Vistasoft contains the following modules:

  • mrAlign : Aligning functional and anatomical data
  • mrAnatomy: Handling anatomical MRI data.
  • mrBOLD : analysis of functional MRI data.
  • mrDiffusion : Diffusion MRI, including DTI and tractography.
  • mrMesh : displaying MR data on rendered 3D surface representations of the brain.
  • mrQuant : quantitative MRI (see also mrQ)
  • mrScripts : a variety of useful scripts

And in addition:

  • utilities
  • setup
  • tutorials
  • external: functions written by others that we use as dependencies (see optional packages).

External dependencies

Vistasoft depends on the following packages:

  • Matlab
    • The code has been validated for Matlab 2014b (8.4) - Matlab 2017b (9.3)
  • SPM

Optional Packages

Documentation

For detailed documentation, please visit the VISTA lab wiki.

Installation

To install Vistasoft:

  1. Clone the Vistasoft repository on your local machine; for example:

    > cd ~/matlab
    > git clone https://github.com/vistalab/vistasoft
    
  2. Start Matlab and Add the Vistasoft repository's base directory to your Matlab path:

    addpath(genpath('~/matlab/vistasoft'));

    Note that if you have installed additional Matlab packages (such as the RemoteDataToolbox), you will have to ensure that these packages are on your path as well.

For help with the new mrInit intialization method, please see the Initialization Page.

vistasoft's People

Contributors

arokem avatar babylab avatar dannbullock avatar digital-pro avatar elinekupers avatar emilykubota avatar francopestilli avatar garikoitz avatar htakemur avatar j-ales avatar jwinawer avatar jyeatman avatar kitchell avatar lmperry avatar mick-d avatar rfdougherty avatar roeysc avatar rokers avatar rosemary-le avatar shmp0722 avatar soichih avatar wadelab avatar wandell avatar wemackey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vistasoft's Issues

Documentation

In:

function dt6FileName = dtiRawFitTensor(dwRaw, bvecs, bvals, outBaseName, bs, fitMethod, brainMask, adcUnits, xformToAcPc)
% Fits a tensor to the raw DW data.
%
% dt6FileName = dtiRawFitTensor([dwRaw=uigetfile],
% [bvecsFile=uigetfile], [bvalsFile=uigetfile], [outBaseDir=uigetdir],
% [bootstrapParams=[]], [fitMethod='ls'], [brainMask=''],
% [adcUnits=dtiGuessAdcUnits], [xformToAcPc=dwRaw.qto_xyz])

Replace:
% [adcUnits=dtiGuessAdcUnits], [xformToAcPc=dwRaw.qto_xyz])
With:
% [adcUnits=dtiGuessDiffusivityUnits], [xformToAcPc=dwRaw.qto_xyz])

Problem when running between scans motion correction

When running between scans motion correction (following a separate run of within-scan motion correction), matlab outputs several "transformation does not need to be applied" and then motion correction fails with the error:

"Initializing HIDDEN Inplane view

nim is NULL! Check to be sure the file exists.
Index exceeds matrix dimensions.
Error in niftiCurrentOrientation (line 24)
imDim = imDim(1:3);
Error in niftiCreateXform (line 29)
[vectorFrom, xform] = niftiCurrentOrientation(nii);
Error in niftiApplyAndCreateXform (line 22)
xform = niftiCreateXform(nii,xformType);
Error in loadtSeries (line 43)
nii = niftiApplyAndCreateXform(nii,'Inplane');
Error in betweenScanMotComp (line 70)
[~, ni] = loadtSeries(vw, scan);
Error in betweenScanMotCompSelScan (line 27)
[vw M] = betweenScanMotComp(vw, typeName, baseScan, targetScans);
Error while evaluating uimenu Callback"

Curiously Ref_scans data type is still created.

Questions on cortical magnification analysis

  1. The first problem is about the Parameters:
    1. What’s meaning of " Stim Foveal Ph" and "Stim Periph Ph" ? I thought foveal and periph mainly concerns eccentricity. How to define the phase of them?
    2. Can bin distance defined randomly or there are any rules?

2013-09-19_000848

2.Questions about Results

I analyzed CMF of one ROI using default parameters, and resulting figures showed below (figure100 and figure 101). And the cortMag file.

  1.  Where can I get the value of  CMF of specific ROI?
    

cortMag =

                ROIs: [1x1 struct]
      paramsFileName: 'CortMag_Flat_Averages_right_130918.mat'
             subject: 'rory'
           timestamp: '18-Sep-2013 17:45:56'
            mmPerPix: [1 1 1]
            coThresh: 0.1000
           expNumber: 2
         nodeIndices: {[1x18 double]}
                bins: {[1x3 struct]}
            dataType: 'Averages'
              subdir: 'Flat'
          hemisphere: 'right'
               slice: 2
             binDist: 4
      stimulusRadius: 20
         fovealPhase: 4.7100
     peripheralPhase: 4.7100
         excludeROIs: []
      templateRoiNum: 1
        flatDataFlag: 0
                data: {[1x1 struct]}
        corticalDist: {[0 3.1463]}
              meanPh: {[0.7807 + 0.0323i 0.3029 - 0.9190i]}
                sePh: {[0.3120 0.1456]}
       distanceShift: 0
     allCorticalDist: [0 3.1463]
           allMeanPh: [0.7807 + 0.0323i 0.3029 - 0.9190i]
             allSEPh: [0.3120 0.1456]
allCorticalDist10deg: [-42.6979 -39.5516]
            fitParms: [1x1 struct]
          allStimDeg: [-15.4719 -19.5899]
        allStimDegSE: [0.9932 0.4635]
        predictedDeg: [1.9781 2.2290] 
  1. I read the codes and found the description x and y for figure100,
    nROIs = length(cortMag.bins);
    pX = ceil(sqrt(nROIs));
    pY = ceil(nROIs/pX);
    xLower = 0;
    xUpper = 100;
    yLower = -pi;
    yUpper = 4*pi;
    but still not clear of the meaning. Could you please explain to me about the how to understand this figure?

Figure 100
2013-09-19_000905

Figure101
figure101

  1.  In many papers, they plotted the relation between eccentricity and CMF, I wonder how to plot relationship between CMF and polar angle phase?
    

Thanks very much!

event related time course UI

When trying to plot time course UI from a scan group, the 'params' field is being taken from the 'Original' data type and NOT the 'GLM' data type:

Taken from er_voxelData.m:

% ras, 04/05.
verbose = prefsVerboseCheck;

% get params, trials, coords
data.trials = er_concatParfiles(view, scans);
data.params = er_getParams(view, scans(1)); % assume all scans have same params
if preserveCoords==0
data.coords = double(roiSubCoords(view, roi.coords)); %, scans(1))); % remove redundant voxels
else
data.coords = double(roi.coords);
end

viewSetColorbar

Hello,

I found a small possible bugs.
When I tried to change the color map in gray view window by right-clicking color bar at the bottom of the GUI, some error message appeared and color map did not change.

Folloiwng is the error message I found:

??? Error using ==> viewSetColorbar at 24
Unknown view parameter cmap.

Error in ==> viewSet at 190
vw = viewSetColorbar(vw,param,val,varargin{:});

24 error('Unknown view parameter %s.', param);

On the other hand, when I tested pulldown menu (e.g. Color Map --> Parameter Map Mode --> Hot Color Map), it worked properly.

Issues with PRF Model

When running Retinotopy analysis, mrVista crashes after the first ffit with the following error (all output included):

Warning: Your current settings will produce an error in a future release.

In fmincon at 510
In rmSearchFit_oneGaussian at 65
In rmSearchFit at 339
In rmMain at 139
Done [16 minutes].
[rmSearchFit_oneGaussian]:Removed negative fits: 0 (0.0%).
[rmSave]:Saved /retModel-20131107-160752-sFit.mat.
[reserveToolbox]:optimization toolbox reserved.
[rmMakeTrends]: Removing 6 trends from combined data.
[rmSearchFit]:Processing voxels with variance explained >= 0.00

ans =

 1

ans =

 1

[rmSearchFit_oneGaussian]:Estimated processing time: 185851 voxels: 3 minutes.
[rmSearchFit_oneGaussian]:Nonlinear optimization (x,y,sigma):..........Done [3 minutes].
[rmSearchFit_oneGaussian]:Removed negative fits: 11486 (6.2%).
[rmSave]:Saved /Gray/Averages/retModel-20131107-160752-fFit.mat.
[reserveToolbox]:optimization toolbox reserved.
[rmMakeTrends]: Removing 6 trends from combined data.

ans =

 1

ans =

 1

[rmHrfSearchFit_oneGaussian]:Making predictions without HRF for each voxel (29762):................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................Done[0 min]. (07-Nov-2013 17:14:31)
[hrfModelSearchFit]:Estimating HRF
Two gamma function: [peak1 width1 peak2 width2 -weight2]
Input (Default): [5.4000 5.2000 10.8000 7.3500 0.3500]
Search range (min): [2.7000 2.6000 5.4000 3.6750 0.0000]
Search range (max): [10.8000 10.4000 21.6000 14.7000 0.7000]
Grid stage output: [5.1300 7.2800 11.8800 8.0850 0.4200](31 min)
Warning: To use the default trust-region-reflective algorithm you must supply the gradient in the
objective function and set the GradObj option to 'on'. FMINCON will use the active-set algorithm instead.
For information on applicable algorithms, see Choosing the Algorithm in the documentation.

In fmincon at 516
In hrfModelSearchFit at 97
In rmHrfSearchFit at 247
In rmMain at 141
Warning: Your current settings will produce an error in a future release.
In fmincon at 526
In hrfModelSearchFit at 97
In rmHrfSearchFit at 247
In rmMain at 141
Error using fmincon (line 779)
FMINCON requires all values returned by user functions to be of data type double.

Error in hrfModelSearchFit (line 97)
hrfParams = ...

Error in rmHrfSearchFit (line 247)
outParams = hrfModelSearchFit(data,prediction,hrfParams,params);

Error in rmMain (line 141)
[view,params] = rmHrfSearchFit(view,params);

Error while evaluating uimenu Callback

Questions on GLM analysis

  1. In GLM analysis with mrVista, block duration is defined by the number of TRs (http://vistalab.stanford.edu/newlm/index.php/MrVista_1_conventions#eventAnalysisParams).
    It's not suitable for blocks with durations that are not the integral times of TR. I wonder whether setting the block duration as 5/3 TR will affect the accuracy of the result. And how to change the code to give a option to define duration use ms?
  2. For very short blocks, say 5s stimuli block followed with a 4s fixation block, how to set the baseline period?

Thanks!

Bug in dtiRawFitTensor.m

if(ischar(dwRaw))
% dwRaw can be a path to the file or the file itself
[dataDir,inBaseName] = fileparts(dwRaw.fname);
else
[dataDir,inBaseName] = fileparts(dwRaw.fname);
end

This seems to be wrong:
[dataDir,inBaseName] = fileparts(dwRaw.fname);

Potentially replace with:
[dataDir,inBaseName] = fileparts(dwRaw);

problem about rmPlotEccPointImage and collapseOverLayersTseries

1.As I use rmPlotEccPointImageNew, sometimes it creates CMF and pointimage result
2014-02-13_102633

with following reminds:

Exiting: Maximum number of function evaluations has been exceeded

     - increase MaxFunEvals option.

     Current function value: 81342895333.160522 

I add a MaxFunEvals optin in the code but it doesn't help.

2 I tried to use collapseOverLayersTseries, but haven’t got it right:

collapseOverLayersTseries(VOLUME{1}, 'connectionMatrix', 1, 'LV1', 'Averages')

  1.   What does connectionMatrix mean?
    
  2.   As I run the code, it stopped with following information
    

Attempt to reference field of non-structure array.

Error in collapseOverLayersTseries (line 34)

    [tmp, RoiCrds] = intersectCols(allCrds,ROI.coords)

Does this caused by no Talairach cords created for the ROI?

mrSession nFrames

Hello

The following code in the mrInit subfunction mrInitInplaneTseries seems to calculate nFrames incorrectly when you specify frames to be clipped from the time series.

The following code
if mr.keepFrames(scan,2) == -1
remainingFrames = mr.dims(4);
else
remainingFrames = mr.keepFrames(scan,2);
end %if
totalDroppedFrames = (mr.dims(4) - remainingFrames) + mr.keepFrames(scan,1);
f.nFrames = mr.dims(4) - totalDroppedFrames;

should probably be changed to
if mr.keepFrames(scan,2) == -1
f.nFrames = mr.dims(4);
else
f.nFrames = mr.keepFrames(scan,2);
end

convert Camino .Bfloat file into Quench .pdb format

Hello, experts,

I want to do retinotopic white matter with my hardi data using both Quench and Camino. When I was trying to convert Camino .Bfloat file into Quench .pdb format, I met some errors. It seemed that, mtrImportFibers.m function(fg = mtrImportFibers(tractsFile,eye(4)); ) can't read or calculate the parameters in my tractsfile. The warnings and all codes I refered are listed below. Can someone help me to solve this problem? Thanks in advance!
2013-04-26_203107

??? Error using ==> horzcat
The following error occurred converting from char
to struct:
Error using ==> struct
Conversion to struct from char is not possible.

Error in ==> fiberToStr3 at 53
disp(['Warning: Invalid param "'
fg.params{ff} '" ... skipping']);

Error in ==> mtrExportFibers at 146
str=fiberToStr3(fg);

All codes I've refered:

% Load seed volume
seedFile = 'camino/wm.nii.gz';
seedNI = readFileNifti(seedFile);

% Calc xform from camino space to surface data
xformMMToSeed = seedNI.qto_ijk;
xformMMToSeed(1:3,4) = 0;
xformSeedToAcPc = seedNI.qto_xyz;
xformAcPcToSurface = surfaceNI.qto_ijk;
xformMMToSurface = xformAcPcToSurface * xformSeedToAcPc * xformMMToSeed;

% Load camino path file
tractsFile = 'camino/tracts.Bfloat';
fg = mtrImportFibers(tractsFile,eye(4));

% Get fibers into AcPc
fg_acpc = dtiXformFiberCoords(fg, xformSeedToAcPc * xformMMToSeed);

% write the fibers into a pdb file
mtrExportfibers(fg_acpc,'fibers.pdb');

Between Scan Motion Compensation

In mrVista, the between scan motion compensation writes out a volume twice the size of the original data (2*slices). e.g. if the input volume is 64x64x39x125, the output volume is 64x64x78x125, with the first 39 slices have value 0, and the data gets written to the second half (slice 40 - 78).

The problem is because:
On line 127, a matrix is initialized (size of original data)
tSeriesFull = zeros([size(ts) length(slices)]);

but on line 134, the code appends to the matrix, and leads to doubling its size.
tSeriesFull = cat(dimNum + 1, tSeriesFull, tSeries);

Line 134 should probably be changed to
tSeriesFull(:,:,slice) = tSeries;

Problem with migrating a session

The following session was migrated:

/biac4/wandell/biac2/wandell6/data/frk/prf/fp20110912/mrvSession1

However, running 'mrVista' produces this error:

cd /biac2/wandell6/data/frk/prf/fp20110912/mrvSession1/
mrVista

Error using openMontageWindow (line 163)
This session has not been upgraded to the most recent version. Please run mrInit_sessionMigration to
update your session.

Error in mrVista (line 83)
[vw, s] = openMontageWindow;

Trying to migrate again produces this output:

mrInit_sessionMigration
Starting a complete session migration...
Inplane anatomy update has already been applied. Will not re-apply.
Inplane anatomy update has been applied correctly.
tSeries functionals update has already been applied. Will not re-apply.
tSeries functionals update has been applied correctly.
...All updates have completed successfully.

niftiRead/niftiWrite

This doesn't quite seem right:

clear all
nib1000 = niftiRead('b1000.nii.gz')

nib1000 =

          data: [4-D single]
         fname: 'b1000.nii.gz'
          ndim: 4
           dim: [144 168 110 108]
        pixdim: [1.2500 1.2500 1.2500 1]
     scl_slope: 1
     scl_inter: 0
       cal_min: 0
       cal_max: 0
    qform_code: 0
    sform_code: 2
      freq_dim: 0
     phase_dim: 0
     slice_dim: 0
    slice_code: 0
   slice_start: 0
     slice_end: 0
slice_duration: 0
     quatern_b: 0
     quatern_c: 0
     quatern_d: 0
     qoffset_x: 0
     qoffset_y: 0
     qoffset_z: 0
          qfac: 0
       qto_xyz: [4x4 double]
       qto_ijk: [4x4 double]
       sto_xyz: [4x4 double]
       sto_ijk: [4x4 double]
       toffset: 0
     xyz_units: 'unknown'
    time_units: 'unknown'
    nifti_type: 1
   intent_code: 0
     intent_p1: 0
     intent_p2: 0
     intent_p3: 0
   intent_name: ''
       descrip: ''
      aux_file: ''
       num_ext: 0
     data_type: 16

nib1000.qto_xyz = nib1000.sto_xyz;
nib1000.qto_ijk = nib1000.sto_ijk;
niftiWrite(nib1000);
clear all

nib1000 = niftiRead('b1000.nii.gz')

nib1000 =

          data: [4-D single]
         fname: 'b1000.nii.gz'
          ndim: 4
           dim: [144 168 110 108]
        pixdim: [1.2500 1.2500 1.2500 1]
     scl_slope: 1
     scl_inter: 0
       cal_min: 0
       cal_max: 0
    qform_code: 0
    sform_code: 2
      freq_dim: 0
     phase_dim: 0
     slice_dim: 0
    slice_code: 0
   slice_start: 0
     slice_end: 0
slice_duration: 0
     quatern_b: 0
     quatern_c: 0
     quatern_d: 0
     qoffset_x: 0
     qoffset_y: 0
     qoffset_z: 0
          qfac: 0
       qto_xyz: [4x4 double]
       qto_ijk: [4x4 double]
       sto_xyz: [4x4 double]
       sto_ijk: [4x4 double]
       toffset: 0
     xyz_units: 'unknown'
    time_units: 'rads'
    nifti_type: 1
   intent_code: 0
     intent_p1: 0
     intent_p2: 0
     intent_p3: 0
   intent_name: ''
       descrip: ''
      aux_file: ''
       num_ext: 0
     data_type: 16

nib1000.qto_ijk

ans =

0.8000         0         0         0
     0    0.8000         0         0
     0         0    0.8000         0
     0         0         0    1.0000

nib1000.sto_ijk

ans =

-0.7985 -0.0304 -0.0383 74.4711
-0.0420 0.7472 0.2827 65.4170
-0.0250 -0.2842 0.7474 67.2391
0 0 0 1.0000

It seems that niftiRead/niftiWrite do not preserve round-trip read/write of changes to these matrices.

Issue Initializing mrVista Session with Lucas Center Nifti

From Harshad in Kalanit's lab:

"I am using niftiFromDicom which is part of the mrVista package to convert inplaneAnatomy & 3D to nifti. Can this be added to the existing code so that I don't have to do it explicitly each time? Also, we use spiral acquisition at the Lucas Center, and am using makenifti (written by Gary Glover) to convert to nifti. Is there any other tool you would recommend using to convert to proper nifti formats?"

Decide whether to completely deprecate coords2Indices

This function was previously deprecated and needed to be added back into the repo. Choose whether this should be completely deprecated, and, if so, what its replacement should be and how to best migrate it.

If this should not be deprecated, write a few test cases to ensure that it will continue to work going forward.

Reliance on 3rd party environment variables

Right now, the freesurfer loader code in vistasoft assumes that freesurfer is installed and the bash environment variables are set etc..

Might be nicer to just instead pass the variables as arguments to the function. With the default being to look at env variables.

In file : fs_ribbon2itk.m
function fs_ribbon2itk(subjID, outfile, fillWithCSF, alignTo, resample_type, in_orientation)

....

%% Find paths
% If the subjID is not a full path then assume it is a subject directory
% within the defined freesurfer subject directory.
if exist(subjID, 'file')
ribbon = subjID;
else
subdir = getenv('SUBJECTS_DIR');
if isempty(subdir),
fshome = getenv('FREESURFER_HOME');
subdir = fullfile(fshome, 'subjects');
end
ribbon = fullfile(subdir, subjID, 'mri', 'ribbon.mgz');
end

Flipped functionals whehn migrating older session

When migrating a session from an older version of mrVista (non-git) to a newer version (latest, as of today), structural scans get flipped, but functional scans remain aligned as before - resulting mismatch between functionals and structurals

pRF issue with rmSave and Inplane ROIs

When I try to run a pRF analysis on an ROI defined in an inplane view, I run into the following issue at the end of the grid fit.

[rmMakeTrends]: Removing 1 trends from combined data.
[rmGridFit]:Number of voxels: 8330.
[rmGridFit_oneGaussian]:Estimated processing time: 7 minutes.   (21-Oct-2014 10:25:12)
[rmGridFit_oneGaussian]:Grid (x,y,sigma) fit:..........Done[7 minutes]. (21-Oct-2014 10:30:39)
Parameter size error.
x
Error using reshape
To RESHAPE the number of elements must not change.

Error in rmSave>myreshape (line 170)
    mapdata = reshape(param.',dims);

Error in rmSave (line 65)
                                param = myreshape(param,dims,coordsInd);

Error in rmGridFit (line 318)
rmFile = rmSave(view,model,params,1,'gFit');

Error in rmMain (line 126)
        view = rmGridFit(view,params);

The code in question is:

function mapdata = myreshape(param,dims,coordsInd)

if isequal(dims, size(param))

    mapdata = param;
    return
end

if ~isequal(length(coordsInd), prod(dims))
    % otherwise
    mapdata = reshape(param.',dims);
else
    mapdata = zeros(dims);
    mapdata(coordsInd) = param;
end;
return;

In this particular case, it seems like we'd want to map the ROI voxels back using coordsInd, as in the third branch there, but as the ROI is smaller than the voxel dimension, we're executing the second (and I'm not sure entirely what its use case is) and crashing.

angleZeroTwoPi.m

I found a bug in mrVista command in
vistasoft/mrBOLD/Utilities/shiftPhase.m

This is because shiftPhase.m uses angleZeroTwoPi.m, which may be removed from recent version of github code (I found this command in old svn code in "deprecate" folder).

There may be two possible solutions:

  1. Add back angleZeroTwoPi.m
  2. Change shiftPhase.m if there were another general MATLAB function which have the same role as angleZeroTwoPi.m

(Following is the copy of the bug on MATLAB)

Error in ==> shiftPhase at 24
shiftedData = angleZeroTwoPi(cxData.*cxPhShift);

Error in ==> cmapWedge at 102
wedge = shiftPhase(wedge, phShift);

Error in ==> setColorBar>setColorBarPolarAngle at 137
wedge = cmapWedge(cmap, startAngle, direction, p);

Error in ==> setColorBar at 51
setColorBarPolarAngle(view, params, cbar);

Error in ==> setDisplayMode at 103
setColorBar(vw, hideState);

Error in ==> rmLoad at 205
view = setDisplayMode(view, fieldNames{sel.field});

Error in ==> rmLoadDefault at 30
view = rmLoad(view, 1, 'polar-angle', 'ph');

Problems with framePeriod and antomical inplane

It seems that Vistasoft cannot recognize framePeriod of our data(Siemens dicom, one dicom contains all slices within a TR) correctly. For example, our TR was 1.5s, while the framePeriod showed in dataTYPES was 3.0125. I thought this error maybe due to wrong slice duration, and the slice duration dimed in nifti was 0.045. Slices of our functional data is 25, TR is 1.5s so the slice duration was 0.06s(1.5s/25), right? So I changed the sliceduration, but framePeriod was still 3.0125. At last I changed the value of framePeriod to 1.5 in the dataTYPES directly. I wonder what determines the value of framePeriod in vistasoft code and is modifying it in dataTYPES a feasible solution?

Another issue is about the anatomical inplane.1) inplane's path. In mrsession.mat created by new code, inplanePath is something like '/media/36E67512E674D399/radilil/functionals/mean.nii', this can be a bit trouble because a disk in Linux named 36E67512E674D399 may be called F in Windows, so when open in different operating systems or computers, I need to change the path everytime. Can this be solved by changing code and don't store path with the disk name, for example, 'new/functionals/mean.nii' maybe enough in most of the situations as long as files needed are in the same disk. 2) In mutual information alignment anat.mat is still needed, so if users want to run mrAlignMI they need to make one with command line. I think perhaps modify the code to find anat.mat in mrsession.mat will be more convenient.

mrInit

I opened MrInit GUI and selected T2 inplane, T1-weighted image and functional scans (all in nifti).
Then I pushed OK button, the following error occurred and I could not do a subsequent analyses.

Following is the error log.

Error using hg.root/get
The name 'Value' is not an accessible property for an instance of class 'root'.

Error in mrInitGUI_main (line 92)
params.doCrop = get(hAnalysis(2), 'Value');

Error in mrInitGUI (line 106)
[params ok] = mrInitGUI_main(params);

Error in mrInit (line 122)
[params, ok] = mrInitGUI;

Inplane/Functional directions flipped

Hello,

I am scanning at the Lucas Center, and am using spiral acquisiton for our fMRI data. I use Gary's makenifti to create the nifti files for the functional data. To create nifti for the anatomical data (inplane, 3D FSPGR), I use niftiFromDicom. I displayed all the nifti's in a third party viewer and they all looked to have the same order of slices. However on analyzing the data using mrInit & mrVista, the inplanes seem to be in a bottom-up order of slices, while the functionals are in a top-down order. I am not sure why the order gets reversed and was hoping to get some help here. I have uploaded the data so that you can analyze it (http://cibsr-mp-302.stanford.edu/forKalanit/Session.zip). You need to vpn into stanford to look at the data. The zip file contains an inplane anatomy scan and a functional scan.

Thanks for your help.

Regards,
Harshad.

Error communicating with mrMeshMac on OSX 10.8.4 matlab r2013a

I got the following error when building a mesh.
FIX: Recompile pnet.c.

I don't want to commit it to the repo because on this machine my mex may not be compatible with osx 10.6. I'll see if I can compile a version compatible with 10.6 - 10.8

%%%%%%%
%Matlab Error Message:
%%%%%%%%%%%

Error using mrMesh (line 73)
Error receiving handshake reply. Message length 0

Error in mrmSet (line 391)
[id,stat,res] = mrMesh(host, windowID, 'enable_origin_arrows', p);

Error in mrmInitMesh (line 30)
mrmSet(msh,'origin lines',0);

Error in meshVisualize (line 43)
[msh, lights] = mrmInitMesh(msh,backColor);

Error in mrmBuild (line 41)
if visualizeFlag, [msh,lights] = meshVisualize(msh); end

Error in meshBuild (line 60)
[newMesh, tenseMesh] = mrmBuild(voxels,viewGet(vw,'mmPerVox'),1);

Error while evaluating uimenu Callback

Question about t1class

I created an ROI on left hemisphere, but sometimes part of the ROI may arise on right hemisphere and vice versa.
2014-02-12_101816

For some subject’s data, when I drawn a ROI, it would be filled with grids.
2014-02-12_102023

Is this caused buy incorrect white and gray matter classification?
FSL: My current t1class was created using FSL with little manual modification except cutting cerebellum. I can't find any holes on ITKSNAP mesh.

Freesurfer: I have tried to use ribbon file created by Freesurfer for a few times, but failed to make it peferctly aligned with individual’s T1 in mrVista 3 though they matched in MRIcron. Are there any tips to solve this problem?
Thanks!
2014-02-12_102228

Flipped Inplane after migration

I have fMRI data (in dicoms) which was pre-processed using an older version of mrVista, so I am running mrInit_sessionMigration to adjust it to the new version.
However, the migration process creates an inplane anatomy which is flipped upside-down relative to the old version. The parameter maps (which we calculated with the older version) are not flipped.
I would like to have the inplane axials in the usual orientation (nose pointing up, cerebellum down). I also need to have the inplane overlapping with the param maps.
Any help will be most appreciated!

mrInit bug

Here is the error when I try to run it:
??? Error: File: mrInit.m Line: 237 Column: 11
Expression or statement is incorrect--possibly unbalanced (, {, or [.

update: might just be a matlab version issue. it only works in version later than 2009.

Problem with anat field in gray view

Apparently viewGet(vw, 'anat') fails in Gray views. Example using vistadata:

cd(fullfile(mrvDataRootPath, 'functional', 'mrBOLD_01'));
vw = initHiddenGray;
viewGet(vw, 'anat')

Error using niftiGet (line 5)
Nifti data structure variable required

Error in viewGetAnatomy (line 24)
val = niftiGet(viewGet(vw,'Anatomy Nifti'),'Data');

Error in viewGet (line 298)
val = viewGetAnatomy(vw,param,varargin{:});

mrmStart errors

when trying to start the mrVista server with mrmStart, the following errors occur:
(machine is 64-bit Ubuntu 12.04)

Ubuntu system detected: Loading mrMeshSrv for Ubuntu 12.04

Loaded pnet MEX-file for the tcp/udp/ip-toolbox Compiled @ May 9 2007 15:06:59
Version 2.0.5 2003-09-16
Copyright (C) Peter Rydes�ter, Sweden, et al. , 1998 - 2003
GNU General Public License, se license.txt for full license notis.
You are allowed to (dynamicaly) link this file with non-free code.

http://www.rydesater.com

REMOTE HOST DISCONNECTED
Warning: could not read msg header. Header length 0

In pnet_readMsg at 31
In mrMesh at 70
In mrmCheckServer at 14
In meshVisualize at 39
Error using mrMesh (line 73)
Error receiving handshake reply. Message length 0

Error in mrmCheckServer (line 14)
stat = mrMesh(host, 999, 'refresh');

Error in meshVisualize (line 39)
if mrmCheckServer, mrMesh(meshGet(msh,'host'),meshGet(msh,'id'),'close'); end

Ubuntu system detected: Loading mrMeshSrv for Ubuntu 12.04
Can't establish connection to mrMeshSrv.
Can't establish connection to mrMeshSrv.
Ubuntu system detected: Loading mrMeshSrv for Ubuntu 12.04
Can't establish connection to mrMeshSrv.
Can't establish connection to mrMeshSrv.
Can't establish connection to mrMeshSrv.
Ubuntu system detected: Loading mrMeshSrv for Ubuntu 12.04
Can't establish connection to mrMeshSrv.
mrmInitMesh: Add mesh actor...
Can't establish connection to mrMeshSrv.
Error using mrmSet (line 90)
Problem adding mesh actor to window.

Error in mrmInitMesh (line 27)
msh = mrmSet(msh,'add actor');

Error in meshVisualize (line 43)
[msh, lights] = mrmInitMesh(msh,backColor);

When to use mean luminance block

"Inserting a mean-luminance block provides an important baseline condition. Without this base-line these large differences in pRF size cannot be distinguished."(Dumoulin & Wandell,2008)"the insertion of mean-luminance blocks (base-line) is crucial to measure large pRF sizes. "
My questions are

  1. Does areas with the large size mainly refer to LO and TO? Then how about V4(I noticed @JWinawer’s paper "Mapping hV4 and ventral occipital cortex" also used bars with blanks, was it mainly because of VO?), if we want to measure pRF size of V1-V4, can we use bars without mean luminance.

  2. Insertion of mean-luminance block is good to measure the large size, but what's the cost of incomplete sweep of leaning bars?

Thanks!

CreateEditData

When I create a new mrSESSION.mat using new dataset, I could not edit mrSESSION from GUI through edit --> edit/view mrSESSION

Following is the error log I got.


Error in CreateEditData (line 14)
sessionFields = fieldnames(session);

Output argument "data" (and maybe others) not
assigned during call to
"/home/htakemur/matlab/git/vistasoft/mrBOLD/Init/CreateEditData.m>CreateEditData".

Error in EditSession (line 67)
inplaneData = CreateEditData(inplaneFields,
mrSESSION.inplanes);

viewMapParameterField

Hi,

When I tried to build new mesh using mrVista, following error occurred.


Error using viewMapParameterField (line 522)
The input classdata does not appear to be in the dictionary

Error in viewGet (line 292)
param = viewMapParameterField(param);

Error in meshBuild>meshGetWhite (line 204)
classData = viewGet(vw,'classdata',hemiName);

Error in meshBuild (line 47)

[voxels,vw] = meshGetWhite(vw, 'left', numGrayLayers);

This is probably because viewGet requires 'classdata', but that is missing in the dictionary. Any solutions?

How to fix dcm2nii transform

The method >> ni = readFileNifti(yourniftiFile);ni = niftiSetQto(ni,ni.sto_xyz);writeFileNifti(ni); suggested by frakkopesto in #28 created a ni struct, in which there were many parameters( for image converted by dcm2nii, values of freq_dim, phase_dim and slice_dim is 0, while values for images converted by MRIConverter seems right-1,2,3 respectively, see pictures for more detail).
ni created for dcm2nii conversion
ricron

ni created for MRIConvert conversion
riconverter

But I am not clear what to do next, I tried to reset the value of freq_dim, phase_dim and slice_dim to 1,2,3 respectively(There are also something wrong with Qto matrix, but I'm not sure how to fix ) and saved the ni struct with names corresponding to original nii images. Then used mrInit again, but that make no difference and warnings listed below.

Warning: [niftiSet] Qto matrix defines an origin very far away from the isocenter.
Warning: [niftiSet] This implies that the Qto matrix could be bad. Please check qto_ijk.
Warning: [niftiSet] Origin to the image center is at [64.000,64.000,17.500] pix.

freq_dim not set correctly in NIFTI header.
phase_dim not set correctly in NIFTI header.
[niftiCheckQto] NIFTI header origin is at or outside the image volume.
[niftiCheckQto] Origin to the image center [64.000,64.000,17.500] pix.
??? Subscript indices must either be real positive integers or logicals.

How to solve this problem, and what to do next when the ni struct is created? Any suggestions? Thanks!

different results when analyzing fiber/ROIs with script or with GUI

Analyzing ROIs or fibers using the function dtiGetValsFromTensors (with trilin interpMethod) yields different FA values than when analyzing the same ROI with the GUI menu.
The GUI computes FA using dtiGetRoiStats, which calculates the mean of the FA image values (mean of imgVals), while dtiGetValsFromTensors computes FA directly from the tensor values. This makes it difficult to compare results and makes the GUI function unusable.
Thanks

some problem about Preservation of Principal Direction

According to many papers, the Preservation of Principal Direction (PPD) should be used for image deformation after Nonlinear registration.The source code is provided at the link of 'https://github.com/vistalab/vistasoft/blob/master/mrDiffusion/xform/dtiXformTensorsPPD.m'. Consequently, the fiber tracts were worse based on the method. I could not find the reason for this result. We would be grateful ifsomeone could give me some suggestions. Or would you provide me a copy of the source code for PPD or others that could help me to understand the PPD method?

Matlab file version of readFileNifti.m does not work to open mrBOLD_01 in vistadata

Platform OSX 10.8.4 Matlab R2013a
Trying to open the mrBOLD_01 session using readFileNifti.m, without the mex compiled version results in an error.

Error message:

Initializing Inplane view
Attaching menus
Using the matlab version of the niftiReader....
Error using xform_nii>change_hdr (line 350)

Non-orthogonal rotation or shearing found inside the affine matrix
in this NIfTI file. You have 3 options:

  1. Using included 'reslice_nii.m' program to reslice the NIfTI
    file. I strongly recommand this, because it will not cause
    negative effect, as long as you remember not to do slice
    time correction after using 'reslice_nii.m'.

  2. Using included 'load_untouch_nii.m' program to load image
    without applying any affine geometric transformation or
    voxel intensity scaling. This is only for people who want
    to do some image processing regardless of image orientation
    and to save data back with the same NIfTI header.

  3. Increasing the tolerance to allow more distortion in loaded
    image, but I don't suggest this.

    To get help, please type:

    help reslice_nii.m
    help load_untouch_nii.m
    help load_nii.m

Error in xform_nii (line 154)
[hdr,orient]=change_hdr(hdr,tolerance,preferredForm);

Error in load_nii (line 135)
nii = xform_nii(nii, tolerance, preferredForm);

Error in readFileNifti (line 55)
nii = load_nii(tmpFileName, volumesToLoad);

Error in niftiRead (line 34)
ni = readFileNifti(fileName);

Error in viewSetAnatomy (line 32)
vw = viewSet(vw,'Anatomy Nifti', niftiRead(val));

Error in viewSet (line 188)
vw = viewSetAnatomy(vw,param,val,varargin{:});

Error in loadAnat (line 34)
vw = viewSet(vw,'Anat Initialize',pathStr);

Error in openMontageWindow (line 157)
INPLANE{s} = loadAnat(INPLANE{s}, sessionGet(mrSESSION,'Inplane Path'));

Error in mrVista (line 83)
[vw, s] = openMontageWindow;

selectDataType

I tried to create a contrast map in MrVista (motion localizer; motion vs. static).
But there was an error and I could not complete the computation of contrast map.

Following is the error messages:

Undefined function 'ne' for input arguments of type 'struct'.

Error in selectDataType (line 33)
if (viewGet(vw, 'Cur Data Type') ~= n)

Error in computeContrastMap2 (line 129)
vw = selectDataType(vw, newDt);

Error in contrastGUI>callComputeContrastMap (line 526)
vw = computeContrastMap2(vw, active, control, saveName, ...

Error in contrastGUI (line 31)

case 4, vw = callComputeContrastMap(s, vw);

The error saying the function ne (~=) does not support 'struct'.
But here, variable 'n' was 'struct' and an error occurred.

Variable 'n' was 1 x 1 struct when I caused an error:

n =

               name: 'VOLUME{1}'
           viewType: 'Gray'
             subdir: 'Gray'
          refreshFn: 'volume3View'
               anat: [256x256x192 uint8]
           mmPerVox: [1 1 1]
                 co: []
                amp: []
                 ph: []
                map: []
            mapName: ''
           mapUnits: ''
            tSeries: []
        tSeriesScan: 2
       tSeriesSlice: 116
               ROIs: []
        selectedROI: 0
        curDataType: 5
            curScan: 1
                loc: [131 170 116]
                 ui: [1x1 struct]
 inplaneLeftIndices: [95592x1 double]
inplaneRightIndices: [89402x1 double]
             coords: [3x184994 double]
              nodes: [8x184994 double]
              edges: [1x1826392 double]
           leftPath: [1x108 char]
          rightPath: [1x108 char]
       allLeftNodes: [8x338284 double]
       allLeftEdges: [1x3379198 double]
      allRightNodes: [8x340837 double]
      allRightEdges: [1x3410068 double]
      leftClassFile: [1x108 char]
     rightClassFile: [1x108 char]

I am not sure which stage I made a mistake.
It will be possible that 'n' should not be a struct but it became a struct because of some other problems. Or selectDataType code should also read struct?

Issues creating a session from NIMS data with Apply Canonical Transform

There appears to be an issue with running mrInit to create a session. This is an issue that Moqian (@tmq010) reported when trying to initialize the dataset here: /biac4/kgs/biac2/kgs/projects/efferenceCopy/fmridata/042913_mt. Other datasets from similar NIMS sessions (e.g. /biac4/kgs/biac2/kgs/projects/efferenceCopy/fmridata/042913_as) appear to work properly, but this one appears to be causing a problem.

The issue seems to be related to the way in which mrAnatComputeCannonicalXformFromDicomXform finds the canonical transform matrix (which should have a single non-zero value per row and column), however, in the case of this error, there are multiple non-zero values there. To reproduce this error, we used the following code in matlab.

ni = niftiRead('/biac2/kgs/projects/efferenceCopy/fmridata/042913_mt/Raw/Anatomy/Inplane/4450_3_1.nii.gz')
ni2 = niftiRead('/biac2/kgs/projects/efferenceCopy/fmridata/043013_as/3_1_18mm_T1_Inplane_Anatomy.nii.gz')
niC = niftiApplyCannonicalXform(ni) % Creates the error
niC = niftiApplyCannonicalXform(ni2) % Works

@rfdougherty - Do you have any thoughts on this issue? It appears to be a standard NIMS dataset that is having trouble this time.

Thanks!

dtiInit: Path names of trilin files are absolute, should be relative

The location and file names of the trilin interpolation files stored in dt6.aligned* are absolute, not relative. For example:

dt6.files.alignedDwBvals

ans =
/home/frk/2t1/fp96_data_variability/dt6_run01_fliprot__4mm/run01_fliprot_aligned_trilin_aligned_trilin.bvals

These files should be stored in a directory within the trilin section, and the path name should be relative. Otherwise we can't move the data as a group. To mitigate this problem, FRK wrote a function dtiDt6Migrate. We should make the need for the function go away.

mrAlignMI error

When I run mrAlignMI included in the latest version of the vistasoft, the code asks the location of anat.mat, which does not exist for the updated data structure. How can I fix this problem?

kaoru

Cannot compile readFileNifti and writeFileNifti from mrvCompile

Platform: OSX 10.8.4 Matlab R2013a

First problem: defaultCFileList.m points to 'fileFilters/nifti/' instead of fileFilters/nifti/C-code'

After fixing that I get a second problem: znzlib.h is missing.

Error message:
[mrvCompile]: Trying to compile /Users/babylab/MATLAB/vistasoft/fileFilters/nifti/C-code/writeFileNifti.c /Users/babylab/MATLAB/vistasoft/fileFilters/nifti/C-code/nifti1_io.c /Users/babylab/MATLAB/vistasoft/fileFilters/nifti/C-code/znzlib.c... (23-Jul-2013 11:36:36)
In file included from /Users/babylab/MATLAB/vistasoft/fileFilters/nifti/C-code/writeFileNifti.c:36:
/Users/babylab/MATLAB/vistasoft/fileFilters/nifti/C-code/nifti1_io.h:20:10: fatal error:
'../zlib/znzlib.h' file not found

include "../zlib/znzlib.h"

Windows 7, Matlab R2010a, File Output Issue.

Hello Vistasoft Community,

I used vistasoft (and related software before) but was having a simple error with dtiInit as I tried to employ the software at a new institution (with new computing infrastructure, etc.). It looks as though matlab/dtiInit can't find the files created after eddy current correct (so tensor-fitting crashes). My matlab output below. I tried having the DTI data in a specific raw (and without this). I tried specifying the output directory. All lead to the same error.

Any thoughts on what I should be doing different?

Thanks much!
Jamie.

parameters=dtiInitParams('phaseEncodeDir',2,'dt6BaseName','Test','outDir','dti15trilin');
dtiInit('dwi.nii.gz','t1w.nii.gz',parameters)
Loading raw data...
Data will be saved to: M:\FastTrack.01\Analysis
Dims = [256 256 68 16]
Data Dir = M:\FastTrack.01\Analysis\DTI_test
Output Dir = M:\FastTrack.01\Analysis
t1FileName = t1w.nii.gz;
freq_dim not set correctly in NIFTI header.
phase_dim not set correctly in NIFTI header.
[dtiRawComputeMeanB0] Finished aligning 0 vols in 0.0 minutes.
[dtiRawComputeMeanB0] Finished resampling 0 vols in 0.0 seconds.
Loading b0 data M:\FastTrack.01\Analysis\dwi_b0.nii.gz...
[dtiRawRohdeEstimateEddyMotion] Aligning vol 1 of 16 to mean b=0 image
[[dtiRawRohdeEstimateEddyMotion] Aligning vol 2 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 3 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 0.7 minutes; 8.0 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 4 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 1.1 minutes; 6.8 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 5 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 2.0 minutes; 7.7 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 6 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 3.0 minutes; 8.1 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 7 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 4.1 minutes; 8.0 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 8 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 4.9 minutes; 7.3 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 9 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 5.8 minutes; 6.6 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 10 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 6.6 minutes; 5.7 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 11 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 7.2 minutes; 4.8 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 12 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 8.2 minutes; 4.1 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 13 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 8.9 minutes; 3.2 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 14 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 9.6 minutes; 2.4 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 15 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 10.4 minutes; 1.6 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Aligning vol 16 of 16 to mean b=0 image
[dtiRawRohdeEstimateEddyMotion] elapsed time 11.2 minutes; 0.8 minutes remaining...
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 1 of 2)
[dtiRawRohdeEstimateEddyMotion] Motion/eddy-current correction for DWI (resolution level 2 of 2)
[dtiRawRohdeEstimateEddyMotion] Saving eddy/motion correction transforms to
M:\FastTrack.01\Analysis\dwi_aligned_trilin_ecXform.mat ...
[dtiRawRohdeEstimateEddyMotion] These transforms map voxels in the reference image (usually the mean b=0) to each raw image.
Loading b0 data M:\FastTrack.01\Analysis\dwi_b0.nii.gz...
[dtiRawAlignToT1] Aligning mean b=0 to t1...
Saving b0 acpcXform to M:\FastTrack.01\Analysis\dwi_aligned_trilin_acpcXform.mat...
[dtiRawResample] Resampling vol 10 of 16 with trilinear interpolation...
data will be saved to M:\FastTrack.01\Analysis\Test.
Computing brain mask from average b0...
saving data as int16...
The system cannot find the path specified.

nim is NULL! Check to be sure the file exists.

Fitting the tensor model...
??? Error using ==> dtiFitTensor
Too many input arguments.

Error in ==> dtiRawFitTensorMex at 241
[dt6,pdd,mdStd,faStd,pddDisp] = dtiFitTensor(d,X,0,bs.permutations,liberalBrainMask);

Error in ==> dtiInit at 268
dt6FileName{1} = dtiRawFitTensorMex(dwRawAligned, dwDir.alignedBvecsFile,...

using dtiGetValsFromTensors with 'fa' flag

When dtiGetValsFromTensors is called with 'fa' or 'famdadrd' valName, for some ROIs the results include FA values greater than 1.
This does not happen for the same ROIs when the function is called with 'dt6' flag, and FA is calculated from the results.

In both cases, the actual calculation is done by the function dtiComputeFA.
In the first case, which produces the odd FA values ('fa' flag), dtiComputeFA gets its input from [eigVec, eigVal] = dtiSplitTensor(val_dt6), while in the second case, dtiComputeFA gets inputs from [vec,val] = dtiEig(dt6); Could the differences between these two functions cause this?

Note that when looking at means the results might look normal, but when looking at the distribution of the FA values there are many voxels with FA greater than 1. When testing ROIs created from FA image mask, the maximal value was 1.2247 for all subjects, which equals sqrt(3/2), the factor by which the FA formula is multiplied...
we'd appreciate your help with solving this.
Thanks

dtiRoiToImg.m

I noticed that when the image resolution is less than 1 mm, dtiRoiToImg.m make some systematic errors.

The error is coming from line 35;
sz = diff(ceil(mrAnatXformCoords(inv(imgXform), bb)))+1;

And this variable 'sz' is an important one to produce Img structure which describes roi coordinates in img position. This function limits the size of Img coordinates based on bounding box, but this one does not work when image resolution is lower than 1 mm by some reasons. It systematically produces the unwanted size of matrix.

This becomes a problem when we transfer a roi defined in mrDiffusion to nifti format. Because dtiRoiNiftiFromMat.m calls dtiRoiToImg to do that.

I need to figure out the solution for this issue...

Issues about Flat and atlas

1.strange flat mesh
flat
I am not sure what's the cause and still check whether t1 is the origin of this problem, because:
I used t1class converted from ribbon (which is segmented from t1.nii created by MRIConverter). Only one subjet's flat data is correct, and the only difference is that his t1 is created using niftifromdicom in Vistasoft.

2 Atlas

As I creat V1/V2/V3 atlas there is a window:

Do the "foveal" and "peripheral" mean the lowest and highiest eccentricity respctively(I filled in 2 and 6 )?
2014-03-05_214801

And what does lower phase mean?
2014-03-05_213603

After I finished and choose datatype to Atlas,and view phase map, I got the result
2014-03-05_212846
Does this indicate that I didn't designate dosal visual areas correctly?

Thanks!

A bug in nifti2functionals.m

Hello,

I am using nifti2functional.m, which transforms nifti (itkGray) files into parameter files which we can read it in mrVista Gui.
For example, I am transforming fiber density data (nifti) into parameter map by using this function.

Currently nifti2functional.m did not work in the newest code.

nifti2functionals.m gets the coords of the vista session by viewGet.m

Now the bug is happening as follows.


??? Error using ==> viewMapParameterField at 518
The input graycoords does not appear to be in the dictionary

Error in ==> viewGet at 292
param = viewMapParameterField(param);

Error in ==> nifti2functionals at 98

coords = viewGet(vw, 'grayCoords');

I assume that this is probably because the viewMapparameterField.m try to read some tags in the maps, but loaded nifti file did not contain any tags.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.