text:
function az = azimuth(varargin)

    report_this_filefun(mfilename('fullpath'));

    %AZIMUTH  Calculates azimuth between points on a geoid
    %
    %  az = AZIMUTH(lat1,lon1,lat2,lon2) computes the great circle
    %  bearing between the two points on the globe.  The inputs
    %  can be matrices of equal size.  The azimuth is reported from
    %  0 to 360 degrees, clockwise from north, by convention.
    %
    %  az = AZIMUTH(lat1,lon1,lat2,lon2,geoid) computes the great circle
    %  bearing assuming that the points lie on the ellipsoid defined by
    %  the input geoid.  The geoid vector is of the form
    %  [semimajor axes, eccentricity].  If omitted, the unit sphere,
    %  geoid = [1 0], is assumed.
    %
    %  az = AZIMUTH(lat1,lon1,lat2,lon2,'units') uses the input string 'units'
    %  to define the angle units of the input and output data.  If
    %  'units' is omitted, 'degrees' is assumed.
    %
    %  az = AZIMUTH(lat1,lon1,lat2,lon2,geoid,'units') is a valid calling form.
    %
    %  az = AZIMUTH('track',...) uses the input string 'track' to define
    %  either a great circle bearing or rhumb line heading.  If 'track' = 'gc',
    %  then the great circle bearings are computed.  If 'track' = 'rh', then
    %  the rhumb line headings are computed.  If omitted, 'gc' is assumed.
    %
    %  az = AZIMUTH(pt1,pt2) uses the input form pt1 = [lat1 lon1] and
    %  pt2 = [lat2 lon2], where lat1, lon1, lat2 and lon2 are column vectors.
    %
    %  az = AZIMUTH(pt1,pt2,geoid), az = AZIMUTH(pt1,pt2,'units'),
    %  az = AZIMUTH(pt1,pt2,geoid,'units') and az = AZIMUTH('track',pt1,...)
    %  are all valid calling forms.
    %
    %  See also DISTANCE, RECKON

    %  Copyright (c)  1995 by Systems Planning and Analysis, Inc.
    %  Written by:  E. Byrns, E. Brown
    %   $Revision: 1399 $    $Date: 2006-08-11 11:19:27 +0200 (Fr, 11 Aug 2006) $

    if nargin < 1
        error('Incorrect number of arguments')
    else
        if ischar(varargin{1})
            str = varargin{1};    varargin(1) = [];
        else
            str = [];
        end
    end

    %  Test the track string and call the appropriate function

    if isempty(str)
        [az,msg] = bearing(varargin{:});
    else
        validstr = ['gc';'rh'];
        indx     = strmatch(lower(str),validstr);
        if length(indx) ~= 1
            error('Unrecognized track string')
        elseif indx == 1
            [az,msg] = bearing(varargin{:});
        elseif indx == 2
            [az,msg] = heading(varargin{:});
        end
    end

    %  Error out if necessary

    if ~isempty(msg);   error(msg);   end

    %************************************************************************
    %************************************************************************
    %************************************************************************

function [az,msg] = bearing(in1,in2,in3,in4,in5,in6)

    %BEARING:  Calculates great circle azimuth between points on a geoid
    %
    %  Purpose
    %
    %  Computes the great circle bearing between two
    %  points on a globe.  The default angle input
    %  is degrees.  The default output is in degrees.
    %  The default geoid is a sphere, but this can be
    %  redefined to an ellipsoid using the geoid input.
    %
    %  Synopsis
    %
    %       az = bearing(pt1,pt2)
    %       az = bearing(pt1,pt2,geoid)
    %       az = bearing(pt1,pt2,'units')
    %       az = bearing(pt1,pt2,geoid,'units')
    %
    %       az = bearing(lat1,lon1,lat2,lon2)
    %       az = bearing(lat1,lon1,lat2,lon2,geoid)
    %       az = bearing(lat1,lon1,lat2,lon2,'units')
    %       az = bearing(lat1,lon1,lat2,lon2,geoid,'units')
    %
    %       [az,errmsg] = bearing(....
    %            If two output arguments are supplied, then error condition
    %            messages are returned to the calling function for processing.

    %   REFERENCES:
    %   For the ellipsoid:  D. H. Maling, Coordinate Systems and
    %   Map Projections, 2nd Edition Pergamon Press, 1992, pp. 74-76.
    %   This forumula can be shown to be equivalent for a sphere to
    %   J. P. Snyder,  "Map Projections - A Working Manual,"  US Geological
    %   Survey Professional Paper 1395, US Government Printing Office,
    %   Washington, DC, 1987,  pp. 29-32.

    %  Copyright (c)  1995 by Systems Planning and Analysis, Inc.
    %  Written by:  E. Byrns, E. Brown
    %  Revision 1.0:  11/7/95
    %  Revision 1.1:  11/26/95  elliptical calcs added   EVB

    %  Initialize outputs

    if nargout ~= 0;  az = [];   msg = [];  end

    %  Test inputs

    if nargin == 2
      if size(in1,2) == 2  && size(in2,2) == 2  && ...
                ndims(in1) == 2 & ndims(in2) == 2
            lat1 = in1(:,1);	lon1 = in1(:,2);
            lat2 = in2(:,1);	lon2 = in2(:,2);
        else
            msg = 'Incorrect latitude and longitude data matrices';
            if nargout < 2;  error(msg);  end
            return
        end

        geoid = [];      units  = [];

    elseif nargin == 3
      if size(in1,2) == 2  && size(in2,2) == 2  && ...
                ndims(in1) == 2 & ndims(in2) == 2
            lat1 = in1(:,1);	lon1 = in1(:,2);
            lat2 = in2(:,1);	lon2 = in2(:,2);
        else
            msg = 'Incorrect latitude and longitude data matrices';
            if nargout < 2;  error(msg);  end
            return
        end

        if ischar(in3)
            units  = in3;               geoid = [];
        else
            units  = [];                geoid = in3;
        end

    elseif nargin == 4

        if ischar(in4)
          if size(in1,2) == 2  && size(in2,2) == 2  && ...
                    ndims(in1) == 2 & ndims(in2) == 2
                lat1 = in1(:,1);	lon1 = in1(:,2);
                lat2 = in2(:,1);	lon2 = in2(:,2);
            else
                msg = 'Incorrect latitude and longitude data matrices';
                if nargout < 2;  error(msg);  end
                return
            end

            geoid = in3;     units  = in4;

        else
            lat1 = in1;	             lon1 = in2;
            lat2 = in3;	             lon2 = in4;
            geoid = [];              units = [];
        end

    elseif nargin == 5

        lat1 = in1;	    lon1 = in2;
        lat2 = in3;	    lon2 = in4;
        if ischar(in5)
            units  = in5;             geoid = [];
        else
            units  = [];              geoid = in5;
        end

    elseif nargin == 6

        lat1 = in1;	    lon1 = in2;
        lat2 = in3;	    lon2 = in4;
        geoid = in5;    units  = in6;

    else
        msg = 'Incorrect number of arguments';
        if nargout < 2;  error(msg);  end
        return
    end

    %  Empty argument tests.  Allows users to pass in an empty argument
    %  and still not crash.

    if isempty(units);   units = 'degrees';   end
    if isempty(geoid)         %  Unlike related functions reckongc
        geoid = [1 0];     %  and distgc, the first argument of geoid
    elseif geoid(1) == 0      %  can not be zero.  Calculations blow up
        geoid(1) = 1;     %  (1/0) if geoid(1) = 0
    end

    %  Dimension tests

    if ~isequal(size(lat1),size(lon1),size(lat2),size(lon2))
        msg = 'Inconsistent dimensions for latitude and longitude';
        if nargout < 2;  error(msg);  end
        return
    end

    %  Angle unit conversion

    lat1 = angledim(lat1,units,'radians');
    lon1 = angledim(lon1,units,'radians');
    lat2 = angledim(lat2,units,'radians');
    lon2 = angledim(lon2,units,'radians');

    %  Test the geoid parameter

    [geoid,msg] = geoidtst(geoid);
    if ~isempty(msg)
        if nargout < 2;  error(msg);  end
        return
    end

    az = zeros(size(lat1));     % Preallocate memory for output
    epsilon = epsm('radians');      % Set tolerance to the pole

    % Identify those cases where a pole is a starting
    % point or a destination, and those cases where it is not

    indx1 = find(lat1 >= pi/2-epsilon); % north pole starts
    indx2 = find(lat1 <= epsilon-pi/2); % south pole starts
    indx3 = find(lat2 >= pi/2-epsilon); % north pole ends
    indx4 = find(lat2 <= epsilon-pi/2); % south pole ends

    indx=1:numel(az);           % All cases,
    indx([indx1;indx2;indx3;indx4])=[];  %   less the special ones

    % Handle the special cases.  For example, anything starting
    % at the north pole must go south (pi).  Starting point
    % has priority in degenerate cases; i.e. when going from
    % north pole to north pole, result will be pi, not zero.

    if ~isempty(indx4);  az(indx4) = pi;   end  %  Arrive going south
    if ~isempty(indx3);  az(indx3) = 0;    end  %  Arrive going north
    if ~isempty(indx2);  az(indx2) = 0;    end  %  Depart going north
    if ~isempty(indx1);  az(indx1) = pi;   end  %  Depart going south

    %  Compute the bearing for either a spherical or elliptical geoid.
    %  Note that for a sphere, ratio = 1, par1 = lat1, par2 = lat2
    %  and fact4 = 0.

    if ~isempty(indx)
        par1 = geod2par(lat1(indx),geoid,'radians');    %  Parametric latitudes
        par2 = geod2par(lat2(indx),geoid,'radians');

        ratio = minaxis(geoid) / geoid(1);  %  Semiminor/semimajor (b/a)
        ratio = ratio^2;

        fact1 = cos(lat2(indx)) .* sin(lon2(indx)-lon1(indx));
        fact2 = ratio * cos(lat1(indx)) .* sin(lat2(indx));
        fact3 = sin(lat1(indx)) .* cos(lat2(indx)) .* cos(lon2(indx)-lon1(indx));
        fact4 = (1-ratio) * sin(lat1(indx)) .* cos(lat2(indx)) .* ...
            cos(par1) ./ cos(par2);

        az(indx) = atan2(fact1,fact2-fact3+fact4);
    end

    %  Transform the bearing data to the proper range and units

    az = zero22pi(az,'radians','exact');
    az = angledim(az,'radians',units);

    %************************************************************************
    %************************************************************************
    %************************************************************************

function [course,msg] = heading(in1,in2,in3,in4,in5,in6)

    %HEADING:  Calculates rhumb-line direction between points on a geoid
    %
    %  Purpose
    %
    %  Computes the rhumb line direction between two
    %  points on a globe.  The rhumb line is a line of
    %  constant angular direction, a "course to steer".
    %  The default angle input is degrees.  The default output
    %  is in degrees. The default geoid is a sphere, but this
    %  can be redefined to an ellipsoid using the geoid input.
    %
    %  Synopsis
    %
    %       course = heading(pt1,pt2)
    %       course = heading(pt1,pt2,geoid)
    %       course = heading(pt1,pt2,'units')
    %       course = heading(pt1,pt2,geoid,'units')
    %
    %       course = heading(lat1,lon1,lat2,lon2)
    %       course = heading(lat1,lon1,lat2,lon2,geoid)
    %       course = heading(lat1,lon1,lat2,lon2,'units')
    %       course = heading(lat1,lon1,lat2,lon2,geoid,'units')
    %
    %       [course,errmsg] = heading(....
    %            If two output arguments are supplied, then error condition
    %            messages are returned to the calling function for processing.

    %  Copyright (c)  1995 by Systems Planning and Analysis, Inc.
    %  Written by:  E. Brown, E. Byrns
    %  Revision 1.0:  11/7/95
    %  Revision 1.1:  11/28/95  V5 matrix assignment.  Mercalc calls.  EVB

    %  Initialize outputs

    if nargout ~= 0;  course = [];   msg = [];  end

    %  Test inputs

    if nargin == 2
        if size(in1,2) == 2 && size(in2,2) == 2 && ...
                ndims(in1) == 2 && ndims(in2) == 2
            lat1 = in1(:,1);	lon1 = in1(:,2);
            lat2 = in2(:,1);	lon2 = in2(:,2);
        else
            msg = 'Incorrect latitude and longitude data matrices';
            if nargout < 2;  error(msg);  end
            return
        end

        geoid = [];    units  = [];

    elseif nargin == 3
        if size(in1,2) == 2 && size(in2,2) == 2 && ...
                ndims(in1) == 2 && ndims(in2) == 2
            lat1 = in1(:,1);	lon1 = in1(:,2);
            lat2 = in2(:,1);	lon2 = in2(:,2);
        else
            msg = 'Incorrect latitude and longitude data matrices';
            if nargout < 2;  error(msg);  end
            return
        end

        if ischar(in3)
            units  = in3;      geoid = [];
        else
            units  = [];       geoid = in3;
        end

    elseif nargin == 4

        if ischar(in4)
            if size(in1,2) == 2 && size(in2,2) == 2 && ...
                    ndims(in1) == 2 && ndims(in2) == 2
                lat1 = in1(:,1);	lon1 = in1(:,2);
                lat2 = in2(:,1);	lon2 = in2(:,2);
            else
                msg = 'Incorrect latitude and longitude data matrices';
                if nargout < 2;  error(msg);  end
                return
            end

            geoid = in3;    units  = in4;

        else
            lat1 = in1;	              lon1 = in2;
            lat2 = in3;	              lon2 = in4;
            geoid = [];               units = [];
        end

    elseif nargin == 5

        lat1 = in1;	    lon1 = in2;
        lat2 = in3;	    lon2 = in4;
        if ischar(in5)
            units  = in5;         geoid = [];
        else
            units  = [];          geoid = in5;
        end

    elseif nargin == 6

        lat1 = in1;	    lon1 = in2;
        lat2 = in3;	    lon2 = in4;
        geoid = in5;    units  = in6;

    else
        msg = 'Incorrect number of arguments';
        if nargout < 2;  error(msg);  end
        return
    end

    %  Empty argument tests.  Allows users to pass in an empty argument
    %  and still not crash.

    if isempty(units);   units = 'degrees';   end
    if isempty(geoid)         %  Unlike related functions reckonrh
        geoid = [1 0];     %  and distrh, the first argument of geoid
    elseif geoid(1) == 0      %  can not be zero.  Merccalc always returns
        geoid(1) = 1;     %  [x,y] = 0 if geoid(1) = 0
    end

    %  Dimension tests

    if  ~isequal(size(lat1),size(lon1),size(lat2),size(lon2))
        msg = 'Inconsistent dimensions for latitude and longitude';
        if nargout < 2;  error(msg);  end
        return
    end

    %  Angle unit conversion

    lat1 = angledim(lat1,units,'radians');
    lon1 = angledim(lon1,units,'radians');
    lat2 = angledim(lat2,units,'radians');
    lon2 = angledim(lon2,units,'radians');

    %  Test the geoid parameter

    [geoid,msg] = geoidtst(geoid);
    if ~isempty(msg)
        if nargout < 2;  error(msg);  end
        return
    end

    course=zeros(size(lat1));     % Preallocate memory for output
    epsilon=epsm('radians');      % Set tolerance to the pole

    % Identify those cases where a pole is a starting
    % point or a destination, and those cases where it is not

    indx1 = find(lat1 >= pi/2-epsilon); % north pole starts
    indx2 = find(lat1 <= epsilon-pi/2); % south pole starts
    indx3 = find(lat2 >= pi/2-epsilon); % north pole ends
    indx4 = find(lat2 <= epsilon-pi/2); % south pole ends

    indx=1:numel(course);           % All cases,
    indx([indx1;indx2;indx3;indx4])=[];  %   less the special ones

    % Handle the special cases.  For example, anything starting
    % at the north pole must go south (pi).  Starting point
    % has priority in degenerate cases; i.e. when going from
    % north pole to north pole, result will be pi, not zero.

    if ~isempty(indx4);  course(indx4) = pi;   end  %  Arrive going south
    if ~isempty(indx3);  course(indx3) = 0;    end  %  Arrive going north
    if ~isempty(indx2);  course(indx2) = 0;    end  %  Depart going north
    if ~isempty(indx1);  course(indx1) = pi;   end  %  Depart going south

    %  Now find the course for the general cases by calculating the
    %  heading angle in a Mercator coordinate system.  The function
    %  MERCCALC handles both spherical and elliptical geoids

    if ~isempty(indx)
        [x1,y1] = merccalc(lat1(indx),lon1(indx),'forward','radians',geoid);
        [x2,y2] = merccalc(lat2(indx),lon2(indx),'forward','radians',geoid);

        %  Find points greater than 180 deg apart.  Take shorter distance route
        %  Allow for some roundoff error

        epsilon = 1E-10;
        shift = find( abs((x2-x1)) > pi*geoid(1)-epsilon);
        if ~isempty(shift)
            x1(shift) = x1(shift) + sign(x2(shift))*2*pi*geoid(1);
        end

        course(indx) = atan2(x2-x1, y2-y1);
    end

    %  Transform the heading data to the proper range and units

    course = zero22pi(course,'radians','exact');
    course = angledim(course,'radians',units);

author: CelsoReyes


text:
function cdf = sech_cdf ( x, a, b )

%*****************************************************************************80
%
%% SECH_CDF evaluates the Hyperbolic Secant CDF.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    20 September 2004
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, real X, the argument of the PDF.
%
%    Input, real A, B, the parameter of the PDF.
%    0.0 < B.
%
%    Output, real CDF, the value of the CDF.
%
  y = ( x - a ) / b;

  cdf = 2.0 * atan ( exp ( y ) ) / pi;

  return
end

author: johannesgerer

repo: jburkardt-m


text:
function failed_bug3177

% WALLTIME 00:20:00
% MEM 3gb
% DEPENDENCY ft_electroderealign mesh2edge poly2tri

%%

load(dccnpath('/home/common/matlab/fieldtrip/data/ftp/tutorial/headmodel_fem/vol.mat'))

%% project electrodes
% this converts on the fly the hexaehders into a polygonal surface mesh and subsequently into a triangulated surface mesh

cfg                 = [];
cfg.elec            = ft_read_sens('standard_1020.elc');
cfg.headshape       = vol;
cfg.method          = 'project';
elec_proj           = ft_electroderealign(cfg);

author: fieldtrip

repo: fieldtrip

save_path: github-repos/MATLAB/fieldtrip-fieldtrip


text:
function params = parseFloatAssertInputs(varargin)
%parseFloatAssertInputs Parse inputs for floating-point assertion functions.
%   params = parseFloatAssertInputs(varargin) parses the input arguments for
%   assertElementsAlmostEqual, assertVectorsAlmostEqual, and compareFcn. It
%   returns a parameter struct containing the fields:
%
%       A    B    ToleranceType    Tolerance    FloorTolerance

%   Steven L. Eddins
%   Copyright 2008-2009 The MathWorks, Inc.

error(nargchk(2, 6, nargin, 'struct'));

params = struct('A', {[]}, 'B', {[]}, 'ToleranceType', {[]}, ...
    'Tolerance', {[]}, 'FloorTolerance', {[]}, 'Message', {''});

% The first two input arguments are always A and B.
params.A = varargin{1};
params.B = varargin{2};
varargin(1:2) = [];

% If the last argument is a message string, process it and remove it from the list.
if (numel(varargin) >= 1) && ischar(varargin{end}) && ...
        ~any(strcmp(varargin{end}, {'relative', 'absolute'}))
    params.Message = varargin{end};
    varargin(end) = [];
end

checkAB(params.A, params.B);

epsilon = max(eps(class(params.A)), eps(class(params.B)));

if numel(varargin) < 3
    % floor_tol not specified; set default.
    params.FloorTolerance = epsilon;
else
    params.FloorTolerance = varargin{3};
end

if numel(varargin) < 2
    % tol not specified; set default.
    params.Tolerance = sqrt(epsilon);
else
    params.Tolerance = varargin{2};
end

if numel(varargin) < 1
    % tol_type not specified; set default.
    params.ToleranceType = 'relative';
else
    params.ToleranceType = varargin{1};
end

%===============================================================================
function checkAB(A, B)
if ~isfloat(A) || ~isfloat(B)
    error('MTEST:parseFloatAssertInputs:inputsNotFloat', ...
        'A and B must be floating-point arrays.');
end

if ~isequal(size(A), size(B))
    error('MTEST:parseFloatAssertInputs:sizeMismatch', ...
        'A and B must have the same size.');
end

author: ricedsp


text:
% PRIORTOOLBOXES Load in the relevant toolboxes for kern.

importLatest('optimi');
importLatest('ndlutil');

author: SheffieldML

repo: GPmat

save_path: github-repos/MATLAB/SheffieldML-GPmat


text:
function mbasis = basis_matrix_overhauser_uni_r ( )

%*****************************************************************************80
%
%% BASIS_MATRIX_OVERHAUSER_UNI_R sets up the right uniform Overhauser spline basis matrix.
%
%  Discussion:
%
%    This basis matrix assumes that the data points P(N-2), P(N-1),
%    and P(N) are uniformly spaced in T, and that P(N-1) corresponds to
%    T = 0, and P(N) to T = 1.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    14 February 2004
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Output, real MBASIS(3,3), the basis matrix.
%
  mbasis(1,1) =   2.0;
  mbasis(1,2) = - 4.0;
  mbasis(1,3) =   2.0;

  mbasis(2,1) = - 3.0;
  mbasis(2,2) =   4.0;
  mbasis(2,3) = - 1.0;

  mbasis(3,1) =   1.0;
  mbasis(3,2) =   0.0;
  mbasis(3,3) =   0.0;

  return
end


text:
function [node,face]=extrudesurf(no,fc,vec)
%
% [node,face]=extrudesurf(no,fc,vec)
%
% create a enclosed surface mesh by extruding an open surface
%
% author: Qianqian Fang, <q.fang at neu.edu>
%
% input:
%
% output:
%      node: 3D node coordinates for the generated surface mesh
%      face: triangular face patches of the generated surface mesh, each
%           row represents a triangle denoted by the indices of the 3 nodes
%
% -- this function is part of iso2mesh toolbox (http://iso2mesh.sf.net)
%

nlen=size(no,1);
if(length(vec)>1)
   node=[no; no+repmat(vec(:)', nlen,1)];
else
   node=[no; no+vec*nodesurfnorm(no, fc)];
end

face=[fc; fc+nlen];

edge=surfedge(fc);
sideface=[edge edge(:,1)+nlen; edge+nlen edge(:,2)];
face=[face; sideface];


text:
function dict = dicm_dict(vendor, flds)
% Return dicom dictionary for specified vendor.
%
% dict = DICM_DICT(vendor, dicmFields);
%
% The vendor is used to assign those vendor-specific private tags for SIEMENS,
% GE and Philips. Other vendors can be added easily into the file.
%
% If only partial dictionary is needed, the struct fields can be used as
% the 2nd input.
%
% See also DICM_HDR, DICM2NII, DICM_IMG

% History (yymmdd):
% 130823 Write it for dicm2nii.m (xiangrui.li@gmail.com)
% 131105 Make DTI parameter names more consistent across vendors.
% 141021 Store requested fields, so set dict when switching vendors.
% 141024 Use LocationsInAcquisition as nSL for all vendors.
% 141030 Make ScanningSequence & SequenceVariant consistent for vendors.
% 150114 Add two more CSA header duplicate tags, and more command tags.
% 160411 dict contains group and element.
% 171211 Add Siemens grp 0021 and more.
% 180514 Guess more Siemens grp 0021 tags, correct BandwidthPerPixelPhaseEncode.
% 180914 Add vendor UIH.

if nargin<1, vendor = 'SIEMENS'; end
dict.vendor = vendor;
% Shortened items common across vendors from Matlab dicom-dict.txt
%    group element vr  name
C = {
    '0002' '0001' 'OB' 'FileMetaInformationVersion'
    '0002' '0002' 'UI' 'MediaStorageSOPClassUID'
    '0002' '0003' 'UI' 'MediaStorageSOPInstanceUID'
    '0002' '0010' 'UI' 'TransferSyntaxUID'
    '0002' '0012' 'UI' 'ImplementationClassUID'
    '0002' '0013' 'SH' 'ImplementationVersionName'
    '0002' '0016' 'AE' 'SourceApplicationEntityTitle'
    '0002' '0100' 'UI' 'PrivateInformationCreatorUID'
    '0008' '0005' 'CS' 'SpecificCharacterSet'
    '0008' '0008' 'CS' 'ImageType'
    '0008' '0012' 'DA' 'InstanceCreationDate'
    '0008' '0013' 'TM' 'InstanceCreationTime'
    '0008' '0014' 'UI' 'InstanceCreatorUID'
    '0008' '0016' 'UI' 'SOPClassUID'
    '0008' '0018' 'UI' 'SOPInstanceUID'
    '0008' '0020' 'DA' 'StudyDate'
    '0008' '0021' 'DA' 'SeriesDate'
    '0008' '0022' 'DA' 'AcquisitionDate'
    '0008' '0023' 'DA' 'ContentDate'
    '0008' '002A' 'DT' 'AcquisitionDateTime'
    '0008' '0030' 'TM' 'StudyTime'
    '0008' '0031' 'TM' 'SeriesTime'
    '0008' '0032' 'TM' 'AcquisitionTime'
    '0008' '0033' 'TM' 'ContentTime'
    '0008' '0050' 'SH' 'AccessionNumber'
    '0008' '0060' 'CS' 'Modality'
    '0008' '0064' 'CS' 'ConversionType'
    '0008' '0070' 'LO' 'Manufacturer'
    '0008' '0080' 'LO' 'InstitutionName'
    '0008' '0081' 'ST' 'InstitutionAddress'
    '0008' '0090' 'PN' 'ReferringPhysicianName'
    '0008' '0100' 'SH' 'CodeValue'
    '0008' '0102' 'SH' 'CodingSchemeDesignator'
    '0008' '0104' 'LO' 'CodeMeaning'
    '0008' '010B' 'CS' 'ContextGroupExtensionFlag'
    '0008' '0201' 'SH' 'TimezoneOffsetFromUTC'
    '0008' '1010' 'SH' 'StationName'
    '0008' '1030' 'LO' 'StudyDescription'
    '0008' '1032' 'SQ' 'ProcedureCodeSequence'
    '0008' '103E' 'LO' 'SeriesDescription'
    '0008' '1040' 'LO' 'InstitutionalDepartmentName'
    '0008' '1048' 'PN' 'PhysicianOfRecord'
    '0008' '1050' 'PN' 'PerformingPhysicianName'
    '0008' '1060' 'PN' 'PhysicianReadingStudy'
    '0008' '1070' 'PN' 'OperatorName'
    '0008' '1080' 'LO' 'AdmittingDiagnosesDescription'
    '0008' '1090' 'LO' 'ManufacturerModelName'
    '0008' '1110' 'SQ' 'ReferencedStudySequence'
    '0008' '1111' 'SQ' 'ReferencedPerformedProcedureStepSequence'
    '0008' '1115' 'SQ' 'ReferencedSeriesSequence'
    '0008' '1120' 'SQ' 'ReferencedPatientSequence'
    '0008' '1140' 'SQ' 'ReferencedImageSequence'
    '0008' '1150' 'UI' 'ReferencedSOPClassUID'
    '0008' '1155' 'UI' 'ReferencedSOPInstanceUID'
    '0008' '1160' 'IS' 'ReferencedFrameNumber'
    '0008' '1199' 'SQ' 'ReferencedSOPSequence'
    '0008' '1250' 'SQ' 'RelatedSeriesSequence'
    '0008' '2111' 'ST' 'DerivationDescription'
    '0008' '2112' 'SQ' 'SourceImageSequence'
    '0008' '2218' 'SQ' 'AnatomicRegionSequence'
    '0008' '9007' 'CS' 'FrameType'
    '0008' '9092' 'SQ' 'ReferencedImageEvidenceSequence'
    '0008' '9121' 'SQ' 'ReferencedRawDataSequence'
    '0008' '9123' 'UI' 'CreatorVersionUID'
    '0008' '9154' 'SQ' 'SourceImageEvidenceSequence'
    '0008' '9205' 'CS' 'PixelPresentation'
    '0008' '9206' 'CS' 'VolumetricProperties'
    '0008' '9207' 'CS' 'VolumeBasedCalculationTechnique'
    '0008' '9208' 'CS' 'ComplexImageComponent'
    '0008' '9209' 'CS' 'AcquisitionContrast'
    '0010' '0010' 'PN' 'PatientName'
    '0010' '0020' 'LO' 'PatientID'
    '0010' '0021' 'LO' 'IssuerOfPatientID'
    '0010' '0030' 'DA' 'PatientBirthDate'
    '0010' '0040' 'CS' 'PatientSex'
	'0010' '0050' 'SQ' 'PatientInsurancePlanCodeSequence'
    '0010' '1000' 'LO' 'OtherPatientID'
    '0010' '1010' 'AS' 'PatientAge'
    '0010' '1020' 'DS' 'PatientSize'
    '0010' '1030' 'DS' 'PatientWeight'
	'0010' '1040' 'LO' 'PatientAddress'
    '0010' '1080' 'LO' 'MilitaryRank'
    '0010' '2110' 'LO' 'ContrastAllergies'
    '0010' '21B0' 'LT' 'AdditionalPatientHistory'
    '0010' '21C0' 'US' 'PregnancyStatus'
	'0010' '2201' 'LO' 'PatientSpeciesDescription'
	'0010' '2210' 'CS' 'AnatomicalOrientationType'
    '0010' '2299' 'LO' 'ResponsibleOrganization'
    '0010' '4000' 'LT' 'PatientComments'
    '0012' '0062' 'CS' 'PatientIdentityRemoved'
    '0012' '0063' 'LO' 'DeidentificationMethod'
	'0012' '0064' 'SQ' 'DeidentificationMethodCodeSequence'
    '0018' '0015' 'CS' 'BodyPartExamined'
    '0018' '0020' 'CS' 'ScanningSequence'
    '0018' '0021' 'CS' 'SequenceVariant'
    '0018' '0022' 'CS' 'ScanOptions'
    '0018' '0023' 'CS' 'MRAcquisitionType'
    '0018' '0024' 'SH' 'SequenceName'
    '0018' '0025' 'CS' 'AngioFlag'
    '0018' '0050' 'DS' 'SliceThickness'
    '0018' '0060' 'DS' 'KVP'
    '0018' '0080' 'DS' 'RepetitionTime'
    '0018' '0081' 'DS' 'EchoTime'
    '0018' '0082' 'DS' 'InversionTime'
    '0018' '0083' 'DS' 'NumberOfAverages'
    '0018' '0084' 'DS' 'ImagingFrequency'
    '0018' '0085' 'SH' 'ImagedNucleus'
    '0018' '0086' 'IS' 'EchoNumber'
    '0018' '0087' 'DS' 'MagneticFieldStrength'
    '0018' '0088' 'DS' 'SpacingBetweenSlices'
    '0018' '0089' 'IS' 'NumberOfPhaseEncodingSteps'
    '0018' '0090' 'DS' 'DataCollectionDiameter'
    '0018' '0091' 'IS' 'EchoTrainLength'
    '0018' '0093' 'DS' 'PercentSampling'
    '0018' '0094' 'DS' 'PercentPhaseFieldOfView'
    '0018' '0095' 'DS' 'PixelBandwidth'
    '0018' '1000' 'LO' 'DeviceSerialNumber'
    '0018' '1012' 'DA' 'DateOfSecondaryCapture'
    '0018' '1014' 'TM' 'TimeOfSecondaryCapture'
    '0018' '1020' 'LO' 'SoftwareVersion'
    '0018' '1030' 'LO' 'ProtocolName'
    '0018' '1050' 'DS' 'SpatialResolution'
    '0018' '1060' 'DS' 'TriggerTime'
    '0018' '1063' 'DS' 'FrameTime'
    '0018' '1088' 'IS' 'HeartRate'
    '0018' '1090' 'IS' 'CardiacNumberOfImages'
    '0018' '1094' 'IS' 'TriggerWindow'
    '0018' '1100' 'DS' 'ReconstructionDiameter'
    '0018' '1110' 'DS' 'DistanceSourceToDetector'
    '0018' '1111' 'DS' 'DistanceSourceToPatient'
    '0018' '1120' 'DS' 'GantryDetectorTilt'
    '0018' '1130' 'DS' 'TableHeight'
    '0018' '1140' 'CS' 'RotationDirection'
    '0018' '1147' 'CS' 'FieldOfViewShape'
    '0018' '1149' 'IS' 'FieldOfViewDimensions'
    '0018' '1150' 'IS' 'ExposureTime'
    '0018' '1151' 'IS' 'XrayTubeCurrent'
    '0018' '1152' 'IS' 'Exposure'
    '0018' '1160' 'SH' 'FilterType'
    '0018' '1170' 'IS' 'GeneratorPower'
    '0018' '1181' 'CS' 'CollimatorType'
    '0018' '1190' 'DS' 'FocalSpot'
    '0018' '1210' 'SH' 'ConvolutionKernel'
    '0018' '1200' 'DA' 'DateOfLastCalibration'
    '0018' '1201' 'TM' 'TimeOfLastCalibration'
    '0018' '1242' 'IS' 'ActualFrameDuration'
    '0018' '1250' 'SH' 'ReceiveCoilName'
    '0018' '1251' 'SH' 'TransmitCoilName'
    '0018' '1310' 'US' 'AcquisitionMatrix'
    '0018' '1312' 'CS' 'InPlanePhaseEncodingDirection'
    '0018' '1314' 'DS' 'FlipAngle'
    '0018' '1315' 'CS' 'VariableFlipAngleFlag'
    '0018' '1316' 'DS' 'SAR'
    '0018' '1318' 'DS' 'dBdt'
    '0018' '1081' 'IS' 'LowRRValue'
    '0018' '1082' 'IS' 'HighRRValue'
    '0018' '1083' 'IS' 'IntervalsAcquired'
    '0018' '1084' 'IS' 'IntervalsRejected'
    '0018' '2003' 'DS' 'FramePrimaryAngleVector'
    '0018' '2004' 'DS' 'FrameSecondaryAngleVector'
    '0018' '2005' 'DS' 'SliceLocationVector'
    '0018' '5100' 'CS' 'PatientPosition'
    '0018' '9004' 'CS' 'ContentQualification'
    '0018' '9005' 'SH' 'PulseSequenceName'
    '0018' '9006' 'SQ' 'MRImagingModifierSequence'
    '0018' '9008' 'CS' 'EchoPulseSequence'
    '0018' '9009' 'CS' 'InversionRecovery'
    '0018' '9010' 'CS' 'FlowCompensation'
    '0018' '9011' 'CS' 'MultipleSpinEcho'
    '0018' '9012' 'CS' 'MultiplanarExcitation'
    '0018' '9014' 'CS' 'PhaseContrast'
    '0018' '9015' 'CS' 'TimeOfFlightContrast'
    '0018' '9016' 'CS' 'Spoiling'
    '0018' '9017' 'CS' 'SteadyStatePulseSequence'
    '0018' '9018' 'CS' 'EchoPlanarPulseSequence'
    '0018' '9019' 'FD' 'TagAngleFirstAxis'
    '0018' '9020' 'CS' 'MagnetizationTransfer'
    '0018' '9021' 'CS' 'T2Preparation'
    '0018' '9022' 'CS' 'BloodSignalNulling'
    '0018' '9024' 'CS' 'SaturationRecovery'
    '0018' '9025' 'CS' 'SpectrallySelectedSuppression'
    '0018' '9026' 'CS' 'SpectrallySelectedExcitation'
    '0018' '9027' 'CS' 'SpatialPresaturation'
    '0018' '9028' 'CS' 'Tagging'
    '0018' '9029' 'CS' 'OversamplingPhase'
    '0018' '9030' 'FD' 'TagSpacingFirstDimension'
    '0018' '9032' 'CS' 'GeometryOfKSpaceTraversal'
    '0018' '9033' 'CS' 'SegmentedKSpaceTraversal'
    '0018' '9034' 'CS' 'RectilinearPhaseEncodeReordering'
    '0018' '9035' 'FD' 'TagThickness'
    '0018' '9036' 'CS' 'PartialFourierDirection'
    '0018' '9037' 'CS' 'CardiacSynchronizationTechnique'
    '0018' '9041' 'LO' 'ReceiveCoilManufacturerName'
    '0018' '9042' 'SQ' 'MRReceiveCoilSequence'
    '0018' '9043' 'CS' 'ReceiveCoilType'
    '0018' '9044' 'CS' 'QuadratureReceiveCoil'
    '0018' '9045' 'SQ' 'MultiCoilDefinitionSequence'
    '0018' '9047' 'SH' 'MultiCoilElementName'
    '0018' '9048' 'CS' 'MultiCoilElementUsed'
    '0018' '9049' 'SQ' 'MRTransmitCoilSequence'
    '0018' '9050' 'LO' 'TransmitCoilManufacturerName'
    '0018' '9051' 'CS' 'TransmitCoilType'
    '0018' '9052' 'FD' 'SpectralWidth'
    '0018' '9053' 'FD' 'ChemicalShiftReference'
    '0018' '9058' 'US' 'MRAcquisitionFrequencyEncodingSteps'
    '0018' '9059' 'CS' 'Decoupling'
    '0018' '9064' 'CS' 'KSpaceFiltering'
    '0018' '9065' 'CS' 'TimeDomainFiltering'
    '0018' '9066' 'US' 'NumberOfZeroFills'
    '0018' '9067' 'CS' 'BaselineCorrection'
    '0018' '9069' 'FD' 'ParallelReductionFactorInPlane'
    '0018' '9073' 'FD' 'AcquisitionDuration'
    '0018' '9074' 'DT' 'FrameAcquisitionDatetime'
    '0018' '9075' 'CS' 'DiffusionDirectionality'
    '0018' '9076' 'SQ' 'DiffusionGradientDirectionSequence'
    '0018' '9077' 'CS' 'ParallelAcquisition'
    '0018' '9078' 'CS' 'ParallelAcquisitionTechnique'
    '0018' '9079' 'FD' 'InversionTimes'
    '0018' '9080' 'ST' 'MetaboliteMapDescription'
    '0018' '9081' 'CS' 'PartialFourier'
    '0018' '9082' 'FD' 'EffectiveEchoTime'
    '0018' '9087' 'FD' 'B_value' % 'DiffusionBValue'
    '0018' '9089' 'FD' 'DiffusionGradientDirection' % DiffusionGradientOrientation
    '0018' '9090' 'FD' 'VelocityEncodingDirection'
    '0018' '9091' 'FD' 'VelocityEncodingMinimumValue'
    '0018' '9093' 'US' 'NumberOfKSpaceTrajectories'
    '0018' '9094' 'CS' 'CoverageOfKSpace'
    '0018' '9095' 'UL' 'SpectroscopyAcquisitionPhaseRows'
    '0018' '9098' 'FD' 'TransmitterFrequency'
    '0018' '9100' 'CS' 'ResonantNucleus'
    '0018' '9101' 'CS' 'FrequencyCorrection'
    '0018' '9103' 'SQ' 'MRSpectroscopyFOVGeometrySequence'
    '0018' '9104' 'FD' 'SlabThickness'
    '0018' '9105' 'FD' 'SlabOrientation'
    '0018' '9106' 'FD' 'MidSlabPosition'
    '0018' '9112' 'SQ' 'MRTimingAndRelatedParametersSequence'
    '0018' '9114' 'SQ' 'MREchoSequence'
    '0018' '9115' 'SQ' 'MRModifierSequence'
    '0018' '9117' 'SQ' 'MRDiffusionSequence'
    '0018' '9118' 'SQ' 'CardiacTriggerSequence'
    '0018' '9119' 'SQ' 'MRAveragesSequence'
    '0018' '9125' 'SQ' 'MRFOVGeometrySequence'
    '0018' '9127' 'UL' 'SpectroscopyAcquisitionDataColumns'
    '0018' '9147' 'CS' 'DiffusionAnisotropyType'
    '0018' '9151' 'DT' 'FrameReferenceDatetime'
    '0018' '9152' 'SQ' 'MRMetaboliteMapSequence'
    '0018' '9054' 'CS' 'VolumeLocalizationTechnique'
    '0018' '9155' 'FD' 'ParallelReductionFactorOutOfPlane'
    '0018' '9159' 'UL' 'SpectroscopyAcquisitionOutOfPlanePhaseSteps'
    '0018' '9126' 'SQ' 'VolumeLocalizationSequence'
    '0018' '9168' 'FD' 'ParallelReductionFactorSecondInPlane'
    '0018' '9170' 'CS' 'RespiratoryMotionCompensationTechnique'
    '0018' '9171' 'CS' 'RespiratorySignalSource'
    '0018' '9172' 'CS' 'BulkMotionCompensationTechnique'
    '0018' '9174' 'CS' 'ApplicableSafetyStandardAgency'
    '0018' '9176' 'SQ' 'OperatingModeSequence'
    '0018' '9177' 'CS' 'OperatingModeType'
    '0018' '9178' 'CS' 'OperatingMode'
    '0018' '9179' 'CS' 'SpecificAbsorptionRateDefinition'
    '0018' '9180' 'CS' 'GradientOutputType'
    '0018' '9181' 'FD' 'SpecificAbsorptionRateValue'
    '0018' '9182' 'FD' 'GradientOutput'
    '0018' '9183' 'CS' 'FlowCompensationDirection'
    '0018' '9198' 'CS' 'FirstOrderPhaseCorrection'
    '0018' '9199' 'CS' 'WaterReferencedPhaseCorrection'
    '0018' '9200' 'CS' 'MRSpectroscopyAcquisitionType'
    '0018' '9218' 'FD' 'TagSpacingSecondDimension'
    '0018' '9220' 'FD' 'FrameAcquisitionDuration'
    '0018' '9226' 'SQ' 'MRImageFrameTypeSequence'
    '0018' '9227' 'SQ' 'MRSpectroscopyFrameTypeSequence'
    '0018' '9231' 'US' 'MRAcquisitionPhaseEncodingStepsInPlane'
    '0018' '9232' 'US' 'MRAcquisitionPhaseEncodingStepsOutOfPlane'
    '0018' '9234' 'UL' 'SpectroscopyAcquisitionPhaseColumns'
    '0018' '9239' 'SQ' 'SpecificAbsorptionRateSequence'
    '0018' '9240' 'US' 'RFEchoTrainLength'
    '0018' '9241' 'US' 'GradientEchoTrainLength'
    '0018' '9302' 'CS' 'AcquisitionType'
    '0018' '9601' 'SQ' 'DiffusionB_MatrixSequence'
    '0018' '9602' 'FD' 'DiffusionB_ValueXX'
    '0018' '9603' 'FD' 'DiffusionB_ValueXY'
    '0018' '9604' 'FD' 'DiffusionB_ValueXZ'
    '0018' '9605' 'FD' 'DiffusionB_ValueYY'
    '0018' '9606' 'FD' 'DiffusionB_ValueYZ'
    '0018' '9607' 'FD' 'DiffusionB_ValueZZ'
    '0020' '000D' 'UI' 'StudyInstanceUID'
    '0020' '000E' 'UI' 'SeriesInstanceUID'
    '0020' '0010' 'SH' 'StudyID'
    '0020' '0011' 'IS' 'SeriesNumber'
    '0020' '0012' 'IS' 'AcquisitionNumber'
    '0020' '0013' 'IS' 'InstanceNumber'
    '0020' '0020' 'CS' 'PatientOrientation'
    '0020' '0030' 'DS' 'ImagePosition'
    '0020' '0032' 'DS' 'ImagePositionPatient'
    '0020' '0035' 'DS' 'ImageOrientation'
    '0020' '0037' 'DS' 'ImageOrientationPatient'
    '0020' '0052' 'UI' 'FrameOfReferenceUID'
    '0020' '0100' 'IS' 'TemporalPositionIdentifier'
    '0020' '0110' 'DS' 'TemporalResolution'
    '0020' '0105' 'IS' 'NumberOfTemporalPositions'
    '0020' '1000' 'IS' 'SeriesInStudy'
    '0020' '1001' 'IS' 'AcquisitionsInSeries'
    '0020' '1002' 'IS' 'ImagesInAcquisition'
    '0020' '1003' 'IS' 'ImagesInSeries'
    '0020' '1004' 'IS' 'AcquisitionsInStudy'
    '0020' '1005' 'IS' 'ImagesInStudy'
    '0020' '1040' 'LO' 'PositionReferenceIndicator'
    '0020' '1041' 'DS' 'SliceLocation'
    '0020' '4000' 'LT' 'ImageComments'
    '0020' '9056' 'SH' 'StackID'
    '0020' '9057' 'UL' 'InStackPositionNumber'
    '0020' '9071' 'SQ' 'FrameAnatomySequence'
    '0020' '9072' 'CS' 'FrameLaterality'
    '0020' '9111' 'SQ' 'FrameContentSequence'
    '0020' '9113' 'SQ' 'PlanePositionSequence'
    '0020' '9116' 'SQ' 'PlaneOrientationSequence'
    '0020' '9128' 'UL' 'TemporalPositionIndex'
    '0020' '9153' 'FD' 'CardiacTriggerDelayTime'
    '0020' '9156' 'US' 'FrameAcquisitionNumber'
    '0020' '9157' 'UL' 'DimensionIndexValues'
    '0020' '9158' 'LT' 'FrameComments'
    '0020' '9164' 'UI' 'DimensionOrganizationUID'
    '0020' '9165' 'AT' 'DimensionIndexPointer'
    '0020' '9167' 'AT' 'FunctionalGroupPointer'
    '0020' '9221' 'SQ' 'DimensionOrganizationSequence'
    '0020' '9222' 'SQ' 'DimensionIndexSequence'
    '0020' '9251' 'FD' 'RRIntervalTimeMeasured'
    '0020' '9254' 'FD' 'RespiratoryIntervalTime'
    '0020' '9255' 'FD' 'RespiratoryTriggerDelayTime'
    '0020' '9421' 'LO' 'DimensionDescriptionLabel'
    '0028' '0002' 'US' 'SamplesPerPixel'
    '0028' '0004' 'CS' 'PhotometricInterpretation'
    '0028' '0006' 'US' 'PlanarConfiguration'
    '0028' '0008' 'IS' 'NumberOfFrames'
    '0028' '0009' 'AT' 'FrameIncrementPointer'
    '0028' '000A' 'AT' 'FrameDimensionPointer'
    '0028' '0010' 'US' 'Rows'
    '0028' '0011' 'US' 'Columns'
    '0028' '0030' 'DS' 'PixelSpacing'
    '0028' '0034' 'IS' 'PixelAspectRatio'
    '0028' '0051' 'CS' 'CorrectedImage'
    '0028' '0100' 'US' 'BitsAllocated'
    '0028' '0101' 'US' 'BitsStored'
    '0028' '0102' 'US' 'HighBit'
    '0028' '0103' 'US' 'PixelRepresentation'
    '0028' '0104' 'US' 'SmallestValidPixelValue'
    '0028' '0105' 'US' 'LargestValidPixelValue'
    '0028' '0106' 'US' 'SmallestImagePixelValue'
    '0028' '0107' 'US' 'LargestImagePixelValue'
    '0028' '0120' 'SS' 'PixelPaddingValue'
    '0028' '0301' 'CS' 'BurnedInAnnotation'
    '0028' '1050' 'DS' 'WindowCenter'
    '0028' '1051' 'DS' 'WindowWidth'
    '0028' '1052' 'DS' 'RescaleIntercept'
    '0028' '1053' 'DS' 'RescaleSlope'
    '0028' '1054' 'LO' 'RescaleType'
    '0028' '1055' 'LO' 'WindowCenterWidthExplanation'
    '0028' '1080' 'LT' 'GrayScale'
    '0028' '1101' 'US' 'RedPaletteColorLookupTableDescriptor'
    '0028' '1102' 'US' 'GreenPaletteColorLookupTableDescriptor'
    '0028' '1103' 'US' 'BluePaletteColorLookupTableDescriptor'
    '0028' '1201' 'OW' 'RedPaletteColorLookupTableData'
    '0028' '1202' 'OW' 'GreenPaletteColorLookupTableData'
    '0028' '1203' 'OW' 'BluePaletteColorLookupTableData'
    '0028' '2000' 'OB' 'ICCProfile'
    '0028' '2002' 'CS' 'ColorSpace'
    '0028' '2110' 'CS' 'LossyImageCompression'
    '0028' '2112' 'DS' 'LossyImageCompressionRatio'
    '0028' '2114' 'CS' 'LossyImageCompressionMethod'
    '0028' '3003' 'LO' 'LUTExplanation'
    '0028' '9001' 'UL' 'DataPointRows'
    '0028' '9002' 'UL' 'DataPointColumns'
    '0028' '9003' 'CS' 'SignalDomainColumns'
    '0028' '9108' 'CS' 'DataRepresentation'
    '0028' '9110' 'SQ' 'PixelMeasuresSequence'
    '0028' '9132' 'SQ' 'FrameVOILUTSequence'
    '0028' '9145' 'SQ' 'PixelValueTransformationSequence'
    '0032' '000A' 'CS' 'StudyStatusID'
    '0032' '000C' 'CS' 'StudyPriorityID'
    '0032' '1030' 'LO' 'ReasonForStudy'
    '0032' '1032' 'PN' 'RequestingPhysician'
    '0032' '1033' 'LO' 'RequestingService'
    '0032' '1060' 'LO' 'RequestedProcedureDescription'
    '0032' '1064' 'SQ' 'RequestedProcedureCodeSequence'
    '0032' '4000' 'LT' 'StudyComments'
    '0038' '0300' 'LO' 'CurrentPatientLocation'
    '0040' '0006' 'PN' 'ScheduledPerformingPhysicianName'
    '0040' '0007' 'LO' 'ScheduledProcedureStepDescription'
    '0040' '0008' 'SQ' 'ScheduledProtocolCodeSequence'
    '0040' '0009' 'SH' 'ScheduledProcedureStepID'
    '0040' '0241' 'AE' 'PerformedStationAETitle'
    '0040' '0242' 'SH' 'PerformedStationName'
    '0040' '0243' 'SH' 'PerformedLocation'
    '0040' '0244' 'DA' 'PerformedProcedureStepStartDate'
    '0040' '0245' 'TM' 'PerformedProcedureStepStartTime'
    '0040' '0250' 'DA' 'PerformedProcedureStepEndDate'
    '0040' '0251' 'TM' 'PerformedProcedureStepEndTime'
    '0040' '0252' 'CS' 'PerformedProcedureStepStatus'
    '0040' '0253' 'SH' 'PerformedProcedureStepID'
    '0040' '0254' 'LO' 'PerformedProcedureStepDescription'
    '0040' '0260' 'SQ' 'PerformedProtocolCodeSequence'
    '0040' '0275' 'SQ' 'RequestAttributesSequence'
    '0040' '0280' 'ST' 'CommentsOnPerformedProcedureStep'
    '0040' '0321' 'SQ' 'FilmConsumptionSequence'
    '0040' '08EA' 'SQ' 'MeasurementUnitsCodeSequence'
    '0040' '1001' 'SH' 'RequestedProcedureID'
    '0040' '1400' 'LT' 'RequestedProcedureComments'
    '0040' '2004' 'DA' 'IssueDateOfImagingServiceRequest'
    '0040' '2017' 'LO' 'FillerOrderNumberOfImagingServiceRequest'
    '0040' '2400' 'LT' 'ImagingServiceRequestComments'
    '0040' '9096' 'SQ' 'RealWorldValueMappingSequence'
    '0040' '9210' 'SH' 'LUTLabel'
    '0040' '9211' 'SS' 'RealWorldValueLastValueMapped'
    '0040' '9216' 'SS' 'RealWorldValueFirstValueMapped'
    '0040' '9224' 'FD' 'RealWorldValueIntercept'
    '0040' '9225' 'FD' 'RealWorldValueSlope'
    '0040' 'A170' 'SQ' 'PurposeOfReferenceCodeSequence'
    '0050' '0004' 'CS' 'CalibrationImage'
    '0050' '0010' 'SQ' 'DeviceSequence'
    '0050' '0014' 'DS' 'DeviceLength'
    '0050' '0016' 'DS' 'DeviceDiameter'
    '0050' '0017' 'CS' 'DeviceDiameterUnits'
    '0050' '0018' 'DS' 'DeviceVolume'
    '0050' '0019' 'DS' 'InterMarkerDistance'
    '0050' '0020' 'LO' 'DeviceDescription'
    '0088' '0140' 'UI' 'StorageMediaFileSetUID'
    '0088' '0200' 'SQ' 'IconImageSequence'
    '0400' '0550' 'SQ' 'ModifiedAttributesSequence'
    '0400' '0561' 'SQ' 'OriginalAttributesSequence'
    '0400' '0562' 'DT' 'AttributeModificationDatetime'
    '0400' '0563' 'LO' 'ModifyingSystem'
    '0400' '0565' 'CS' 'ReasonForTheAttributeModification'
    '0054' '0016' 'SQ' 'RadiopharmaceuticalInformationSequence'
    '0054' '0081' 'US' 'LocationsInAcquisition' % 'NumberOfSlices'
    '0054' '0101' 'US' 'NumberOfTemporalPositions' % 'NumberOfTimeSlices'
    '0054' '0202' 'CS' 'TypeOfDetectorMotion'
    '0054' '0410' 'SQ' 'PatientOrientationCodeSequence'
    '0054' '0414' 'SQ' 'PatientGantryRelationshipCodeSequence'
    '0054' '1000' 'CS' 'SeriesType'
    '0054' '1001' 'CS' 'Units'
    '0054' '1002' 'CS' 'CountsSource'
    '0054' '1100' 'CS' 'RandomsCorrectionMethod'
    '0054' '1101' 'LO' 'AttenuationCorrectionMethod'
    '0054' '1102' 'CS' 'DecayCorrection'
    '0054' '1103' 'LO' 'ReconstructionMethod'
    '0054' '1105' 'LO' 'ScatterCorrectionMethod'
    '0054' '1300' 'DS' 'FrameReferenceTime'
    '0054' '1321' 'DS' 'DecayFactor'
    '0054' '1330' 'US' 'ImageIndex'
    '0070' '0052' 'SL' 'DisplayedAreaTLHC'
    '0070' '0053' 'SL' 'DisplayedAreaBRHC'
    '0070' '005A' 'SQ' 'DisplayedAreaSelectionSequence'
    '0070' '0080' 'CS' 'ContentLabel'
    '0070' '0081' 'LO' 'ContentDescription'
    '0070' '0082' 'DA' 'PresentationCreationDate'
    '0070' '0083' 'TM' 'PresentationCreationTime'
    '0070' '0100' 'CS' 'PresentationSizeMode'
    '0070' '0101' 'DS' 'PresentationPixelSpacing'
    '0070' '0102' 'IS' 'PresentationPixelAspectRatio'
    '2050' '0020' 'CS' 'PresentationLUTShape'
    '5200' '9229' 'SQ' 'SharedFunctionalGroupsSequence'
    '5200' '9230' 'SQ' 'PerFrameFunctionalGroupsSequence'
    '5600' '0020' 'OF' 'PixelData' % SpectroscopyData
    '7FE0' '0010' 'OW' 'PixelData' };

% Following add vendor specific tags
if strncmpi(vendor, 'SIEMENS', 7)
    C = [C; {
    '0019' '1008' 'CS' 'Private_0019_10xxType'
    '0019' '1009' 'LO' 'Private_0019_10xxVersion'
    '0019' '100A' 'US' 'LocationsInAcquisition' % 'NumberOfImagesInMosaic'
    '0019' '100B' 'DS' 'SliceMeasurementDuration'
    '0019' '100C' 'IS' 'B_value'
    '0019' '100D' 'CS' 'DiffusionDirectionality'
    '0019' '100E' 'FD' 'DiffusionGradientDirection'
    '0019' '100F' 'SH' 'GradientMode'
    '0019' '1011' 'SH' 'FlowCompensation'
    '0019' '1012' 'SL' 'TablePositionOrigin'
    '0019' '1013' 'SL' 'ImaAbsTablePosition'
    '0019' '1014' 'IS' 'ImaRelTablePosition'
    '0019' '1015' 'FD' 'SlicePosition_PCS'
    '0019' '1016' 'DS' 'TimeAfterStart'
    '0019' '1017' 'DS' 'SliceResolution'
    '0019' '1018' 'IS' 'RealDwellTime'
    '0019' '1025' 'DS' 'RBMoCoTrans'
    '0019' '1026' 'DS' 'RBMoCoRot'
    '0019' '1027' 'FD' 'B_matrix'
    '0019' '1028' 'FD' 'BandwidthPerPixelPhaseEncode'
    '0019' '1029' 'FD' 'MosaicRefAcqTimes'
% group 0021 from here by guess
	'0021' '1001' 'IS' 'UsedPatientWeight' % 76
	'0021' '1004' 'DS' 'NumberOfPrescans' % 1 ??
	'0021' '1005' 'IS' 'RelTablePosition' % 0 0 0 ?
	'0021' '1006' 'LO' 'CoilForGradient' % void ? VR not right
	'0021' '1008' 'SH' 'GradientMode' % Fast/Normal ?
	'0021' '1009' 'LO' 'PATModeText' % p2
% 	'0021' '100A' 'DS' 'Private_0021_100a' % 1
% 	'0021' '100D' 'US' 'Private_0021_100d' % 0
	'0021' '100F' 'DS' 'Stim_lim' % 30.312 28.138 29.305 ?
	'0021' '1010' 'IS' 'MrProtocolVersion' % 61010002 ?
% 	'0021' '1011' 'DS' 'Private_0021_1011' % 0
	'0021' '1012' 'FD' 'ReadoutOS' % 2 ?
% 	'0021' '1013' 'DS' 'Private_0021_1013' % 0
% 	'0021' '1014' 'IS' 'Private_0021_1014' % 0
% 	'0021' '1016' 'DS' 'Private_0021_1016' % 0
% 	'0021' '1017' 'DS' 'Private_0021_1017' % 0
	'0021' '1018' 'SH' 'RFSWDMostCriticalAspect' % Head ?
	'0021' '1019' 'CS' 'MrPhoenixProtocol'
% 	'0021' '101B' 'DS' 'Private_0021_101b' % 1
	'0021' '101C' 'DS' 'Stim_max_online' % 17.0793 2.73105 1.00829 ?
% 	'0021' '101D' 'IS' 'Private_0021_101d' % 0
	'0021' '1022' 'SH' 'SequenceFileOwner' % SIEMENS
% 	'0021' '1023' 'IS' 'Private_0021_1023' % 0
	'0021' '1025' 'SL' 'TablePositionOrigin'
	'0021' '1026' 'IS' 'MiscSequenceParam'
% 	'0021' '1027' 'US' 'Private_0021_1027' % 1
	'0021' '102A' 'IS' 'CoilId'
	'0021' '102B' 'ST' 'PatReinPattern'
	'0021' '102C' 'DS' 'Sed' % 14400 367.175 365.369 ?
	'0021' '102D' 'DS' 'SARMostCriticalAspect' % 3.2 0.618899 0.38146 ?
	'0021' '102E' 'IS' 'Stim_mon_mode' % 2 ? or Operation_mode_flag
	'0021' '102F' 'DS' 'GradientDelayTime' % 35 33 29 ??
% 	'0021' '1030' 'DS' 'Private_0021_1030' % 0
	'0021' '1031' 'IS' 'AbsTablePosition' % -1129
% 	'0021' '1032' 'SS' 'Private_0021_1032' % 0
	'0021' '1033' 'SH' 'CoilForGradient2' % GC25 / GC99?
% 	'0021' '1034' 'DS' 'Private_0021_1034' % 1
	'0021' '1035' 'DS' 'Stim_max_ges_norm_online' % 0.572783 ?
% 	'0021' '1036' 'DS' 'Private_0021_1036' % 0
	'0021' '1037' 'SH' 'FlowCompensation' % No ?
	'0021' '1038' 'DS' 'TransmitterCalibration' % 378.488 ?
% 	'0021' '103B' 'DS' 'Private_0021_103b' % 0
	'0021' '103D' 'CS' 'PhaseSliceOversampling' % NONE / 3D ?
	'0021' '1044' 'DS' 'B1rms' % 100 1.09702 ?
	'0021' '1045' 'CS' 'B1rmsSupervision' % YES ?
	'0021' '1046' 'DS' 'TalesReferencePower' % 2333.36 ?
	'0021' '1049' 'CS' 'AcquisitionContrast' % DIFFUSION ?
	'0021' '1050' 'US' 'RFEchoTrainLength' % 1
	'0021' '1051' 'US' 'EchoTrainLength' % 71 ?
	'0021' '1053' 'CS' 'Laterality4MF' % U ?
	'0021' '105A' 'CS' 'ScanningSequence' % EP
	'0021' '105B' 'CS' 'SequenceVariant' % SK\SP
	'0021' '105C' 'CS' 'ScanOptions' % PFP\FS
% 	'0021' '105D' 'SL' 'Private_0021_105d' % -31 / -63
	'0021' '10FE' 'SQ' 'CSASeriesHeaderInfo'
	'0021' '1103' 'DS' 'SliceMeasurementDuration' % 90000 ?
	'0021' '1104' 'DS' 'TimeAfterStart'
	'0021' '1106' 'LO' 'ICE_Dims'
	'0021' '111A' 'SH' 'RFSWDDataType' % measured/predicted
	'0021' '111C' 'IS' 'PhaseEncodingDirectionPositive' % 1/0
	'0021' '1124' 'IS' 'ProtocolSliceNumber' % 0 ?
	'0021' '1133' 'IS' 'EchoLinePosition' % 96 ?
	'0021' '1141' 'SH' 'GSWDDataType' % measured/predicted
	'0021' '1142' 'IS' 'RealDwellTime' % 2400 ?
	'0021' '1145' 'SL' 'AbsTablePosition' % 0 0 -1129
	'0021' '1148' 'IS' 'EchoPartitionPosition' % 32?
	'0021' '1149' 'IS' 'EchoColumnPosition' % 96 ?
	'0021' '114E' 'IS' 'Actual3DImaPartNumber' % 0 ?
	'0021' '114F' 'LO' 'CoilString' % HE1-4
	'0021' '1151' 'UL' 'SequenceMask' % 134217734
	'0021' '1153' 'FD' 'BandwidthPerPixelPhaseEncode'
	'0021' '1156' 'LO' 'PATModeText' % p2
	'0021' '1158' 'SH' 'AcquisitionMatrixText' % 384p*384 I
	'0021' '1159' 'IS' 'RelTablePosition' % 0 0 0 ?
	'0021' '115B' 'FD' 'SlicePosition_PCS'
% 	'0021' '115E' 'IS' 'MeasuredFourierLines' % 0 or MultistepIndex?
	'0021' '1171' 'UT' 'UsedChannelString'
	'0021' '1175' 'CS' 'ImageTypeText'
	'0021' '1176' 'LO' 'ImageHistory'
	'0021' '1177' 'LO' 'SequenceName' % *ep_b1000#12
% 	'0021' '1178' 'CS' 'Private_0021_1178' % ND / DIS2D
% 	'0021' '1179' 'CS' 'Private_0021_1179' % ND / DIS2D
	'0021' '1188' 'DS' 'SliceLocation'
	'0021' '1189' 'FD' 'InversionTimes' % 900 ?
	'0021' '118A' 'IS' 'FrameNumberInSeries' % ? xiangrui names it
	'0021' '11FE' 'SQ' 'CSAImageHeaderInfo'
% 	'0021' '1201' 'LO' 'Private_0021_1201' % ACQUISITION
% 	'0021' '1202' 'LO' 'Private_0021_1202' % ACQUISITION
    '0029' '1008' 'CS' 'CSAImageHeaderType'
    '0029' '1009' 'LO' 'CSAImageHeaderVersion'
    '0029' '1010' 'OB' 'CSAImageHeaderInfo'
    '0029' '1018' 'CS' 'CSASeriesHeaderType'
    '0029' '1019' 'LO' 'CSASeriesHeaderVersion'
    '0029' '1020' 'OB' 'CSASeriesHeaderInfo'
    '0029' '1110' 'OB' 'CSAImageHeaderInfo'
    '0029' '1120' 'OB' 'CSASeriesHeaderInfo'
    '0029' '1131' 'LO' 'PMTFInformation1'
    '0029' '1132' 'UL' 'PMTFInformation2'
    '0029' '1133' 'UL' 'PMTFInformation3'
    '0029' '1134' 'CS' 'PMTFInformation4'
    '0029' '1160' 'LO' 'SeriesWorkflowStatus'
    '0029' '1260' 'LO' 'SeriesWorkflowStatus'
    '0051' '1008' 'CS' 'Private_0051_10xx_Type'
    '0051' '1009' 'LO' 'Private_0051_10xx_Version'
    '0051' '100A' 'LO' 'TimeOfAcquisition'
    '0051' '100B' 'LO' 'AcquisitionMatrixText'
    '0051' '100C' 'LO' 'FieldOfView'
    '0051' '100D' 'SH' 'SlicePositionText'
    '0051' '100E' 'LO' 'ImageOrientation'
    '0051' '100F' 'LO' 'CoilString'
    '0051' '1011' 'LO' 'ImaPATModeText'
    '0051' '1012' 'SH' 'TablePositionText'
    '0051' '1013' 'SH' 'PositivePCSDirections'
    '0051' '1015' 'SH' 'DataFilterText' % not sure
    '0051' '1016' 'LO' 'ImageTypeText'
    '0051' '1017' 'SH' 'SliceThicknessText'
    '0051' '1019' 'LO' 'ScanOptionsText'
    }];
elseif strncmpi(vendor, 'GE', 2)
    C = [C; {
    '0009' '1001' 'LO' 'FullFidelity'
    '0009' '1002' 'SH' 'SuiteId'
    '0009' '1004' 'SH' 'ProductId'
    '0009' '1027' 'SL' 'ImageActualDate'
    '0009' '1030' 'SH' 'ServiceId'
    '0009' '1031' 'SH' 'MobileLocationNumber'
    '0009' '10E3' 'UI' 'EquipmentUID'
    '0009' '10E7' 'UL' 'ExamRecordChecksum'
    '0009' '10E9' 'SL' 'ActualSeriesDataTimeStamp'
    '0019' '100F' 'DS' 'HorizFrameOfRef'
    '0019' '1011' 'SS' 'SeriesContrast'
    '0019' '1012' 'SS' 'LastPseq'
    '0019' '1017' 'SS' 'SeriesPlane'
    '0019' '1018' 'LO' 'FirstScanRas'
    '0019' '1019' 'DS' 'FirstScanLocation'
    '0019' '101A' 'LO' 'LastScanRas'
    '0019' '101B' 'DS' 'LastScanLoc'
    '0019' '101E' 'DS' 'DisplayFieldOfView'
    '0019' '105A' 'FL' 'AcquisitionDuration'
    '0019' '107D' 'DS' 'SecondEcho'
    '0019' '107E' 'SS' 'NumberOfEchoes'
    '0019' '107F' 'DS' 'TableDelta'
    '0019' '1081' 'SS' 'Contiguous'
    '0019' '1084' 'DS' 'PeakSAR'
    '0019' '1085' 'DS' 'MonitorSAR'
    '0019' '1087' 'DS' 'CardiacRepetitionTime'
    '0019' '1088' 'SS' 'ImagesPerCardiacCycle'
    '0019' '108A' 'SS' 'ActualReceiveGainAnalog'
    '0019' '108B' 'SS' 'ActualReceiveGainDigital'
    '0019' '108D' 'DS' 'DelayAfterTrigger'
    '0019' '108F' 'SS' 'Swappf'
    '0019' '1090' 'SS' 'PauseInterval'
    '0019' '1091' 'DS' 'PauseTime'
    '0019' '1092' 'SL' 'SliceOffsetOnFreqAxis'
    '0019' '1093' 'DS' 'AutoPrescanCenterFrequency'
    '0019' '1094' 'SS' 'AutoPrescanTransmitGain'
    '0019' '1095' 'SS' 'AutoPrescanAnalogReceiverGain'
    '0019' '1096' 'SS' 'AutoPrescanDigitalReceiverGain'
    '0019' '1097' 'SL' 'BitmapdefiningCVs'
    '0019' '1098' 'SS' 'CenterFreqMethod'
    '0019' '109B' 'SS' 'PulseSequenceMode'
    '0019' '109C' 'LO' 'PulseSequenceName'
    '0019' '109D' 'DT' 'PulseSequenceDate'
    '0019' '109E' 'LO' 'SequenceName' % 'InternalPulseSequenceName'
    '0019' '109F' 'SS' 'TransmittingCoilType'
    '0019' '10A0' 'SS' 'SurfaceCoilType'
    '0019' '10A1' 'SS' 'ExtremityCoilflag'
    '0019' '10A2' 'SL' 'RawDataRunNumber'
    '0019' '10A3' 'UL' 'CalibratedFieldStrength'
    '0019' '10A4' 'SS' 'SATFatWaterBone'
    '0019' '10A7' 'DS' 'UserData0'
    '0019' '10A8' 'DS' 'UserData1'
    '0019' '10A9' 'DS' 'UserData2'
    '0019' '10AA' 'DS' 'UserData3'
    '0019' '10AB' 'DS' 'UserData4'
    '0019' '10AC' 'DS' 'UserData5'
    '0019' '10AD' 'DS' 'UserData6'
    '0019' '10AE' 'DS' 'UserData7'
    '0019' '10AF' 'DS' 'UserData8'
    '0019' '10B0' 'DS' 'UserData9'
    '0019' '10B1' 'DS' 'UserData10'
    '0019' '10B2' 'DS' 'UserData11'
    '0019' '10B3' 'DS' 'UserData12'
    '0019' '10B4' 'DS' 'UserData13'
    '0019' '10B5' 'DS' 'UserData14'
    '0019' '10B6' 'DS' 'UserData15'
    '0019' '10B7' 'DS' 'UserData16'
    '0019' '10B8' 'DS' 'UserData17'
    '0019' '10B9' 'DS' 'UserData18'
    '0019' '10BA' 'DS' 'UserData19'
    '0019' '10BB' 'DS' 'DiffusionDirectionX' %'UserData20'
    '0019' '10BC' 'DS' 'DiffusionDirectionY' %'UserData21'
    '0019' '10BD' 'DS' 'DiffusionDirectionZ' %'UserData22'
    '0019' '10BE' 'DS' 'ProjectionAngle'
    '0019' '10C0' 'SS' 'SaturationPlanes'
    '0019' '10C2' 'SS' 'SATlocationR'
    '0019' '10C3' 'SS' 'SATlocationL'
    '0019' '10C4' 'SS' 'SATlocationA'
    '0019' '10C5' 'SS' 'SATlocationP'
    '0019' '10C6' 'SS' 'SATlocationH'
    '0019' '10C7' 'SS' 'SATlocationF'
    '0019' '10C8' 'SS' 'SATThicknessRL'
    '0019' '10C9' 'SS' 'SATThicknessAP'
    '0019' '10CA' 'SS' 'SATThicknessHF'
    '0019' '10CB' 'SS' 'PhaseContrastFlowAxis'
    '0019' '10CC' 'SS' 'VelocityEncoding'
    '0019' '10CD' 'SS' 'ThicknessDisclaimer'
    '0019' '10CE' 'SS' 'PrescanType'
    '0019' '10CF' 'SS' 'PrescanStatus'
    '0019' '10D2' 'SS' 'ProjectionAlgorithm'
    '0019' '10D5' 'SS' 'FractionalEcho'
    '0019' '10D7' 'SS' 'CardiacPhaseNumber'
    '0019' '10D8' 'SS' 'VariableEchoflag'
    '0019' '10D9' 'DS' 'ConcatenatedSAT'
    '0019' '10DF' 'DS' 'UserData23'
    '0019' '10E0' 'DS' 'NumberOfDiffusionDirection' %'UserData24'
    '0019' '10E2' 'DS' 'VelocityEncodeScale'
    '0019' '10F2' 'SS' 'FastPhases'
    '0019' '10F9' 'DS' 'TransmitGain'
    '0020' '9301' 'FD' 'ImagePositionPatient' % These 4 are not private
    '0020' '9302' 'FD' 'ImageOrientationPatient' % but seems used only by GE
    '0020' '930E' 'SQ' 'PlanePositionSequence'
    '0020' '930F' 'SQ' 'PlaneOrientationSequence'
    '0021' '1003' 'SS' 'SeriesFromWhichPrescribed'
    '0021' '1035' 'SS' 'SeriesFromWhichPrescribed'
    '0021' '1036' 'SS' 'ImageFromWhichPrescribed'
    '0021' '1037' 'SS' 'ScreenFormat'
    '0021' '104F' 'SS' 'LocationsInAcquisition'
    '0021' '1050' 'SS' 'GraphicallyPrescribed'
    '0021' '1051' 'DS' 'RotationFromSourceXRot'
    '0021' '1052' 'DS' 'RotationFromSourceYRot'
    '0021' '1053' 'DS' 'RotationFromSourceZRot'
    '0021' '1056' 'SL' 'Num3DSlabs'
    '0021' '1057' 'SL' 'LocsPer3DSlab'
    '0021' '1058' 'SL' 'Overlaps'
    '0021' '1059' 'SL' 'ImageFiltering'
    '0021' '105A' 'SL' 'DiffusionDirection'
    '0021' '105B' 'DS' 'TaggingFlipAngle'
    '0021' '105C' 'DS' 'TaggingOrientation'
    '0021' '105D' 'DS' 'TagSpacing'
    '0021' '105E' 'DS' 'RTIA_timer'
    '0021' '105F' 'DS' 'Fps'
    '0021' '1081' 'DS' 'AutoWindowLevelAlpha'
    '0021' '1082' 'DS' 'AutoWindowLevelBeta'
    '0021' '1083' 'DS' 'AutoWindowLevelWindow'
    '0021' '1084' 'DS' 'AutoWindowLevelLevel'
    '0023' '1070' 'FD' 'StartTimeInFirstAxial'
    '0023' '1074' 'SL' 'NumberOfUpdatesToHeader'
    '0023' '107D' 'SS' 'IndicatesStudyHasCompleteInfo'
    '0025' '1006' 'SS' 'LastPulseSequenceUsed'
    '0025' '1007' 'SL' 'ImagesInSeries'
    '0025' '1010' 'SL' 'LandmarkCounter'
    '0025' '1011' 'SS' 'NumberOfAcquisitions'
    '0025' '1014' 'SL' 'IndicatesNumberOfUpdatesToHeader'
    '0025' '1017' 'SL' 'SeriesCompleteFlag'
    '0025' '1018' 'SL' 'NumberOfImagesArchived'
    '0025' '1019' 'SL' 'LastImageNumberUsed'
    '0025' '101A' 'SH' 'PrimaryReceiverSuiteAndHost'
    '0025' '101B' 'OB' 'ProtocolDataBlock'
    '0027' '1006' 'SL' 'ImageArchiveFlag'
    '0027' '1010' 'SS' 'ScoutType'
    '0027' '1031' 'SS' 'ImagingMode'
    '0027' '1032' 'SS' 'PulseSequence'
    '0027' '1033' 'UL' 'ImagingOptions'
    '0027' '1035' 'SS' 'PlaneType'
    '0027' '1040' 'SH' 'RASletterOfImageLocation'
    '0027' '1041' 'FL' 'ImageLocation'
    '0027' '1042' 'FL' 'CenterRCoordOfPlaneImage'
    '0027' '1043' 'FL' 'CenterACoordOfPlaneImage'
    '0027' '1044' 'FL' 'CenterSCoordOfPlaneImage'
    '0027' '1045' 'FL' 'NormalRCoord'
    '0027' '1046' 'FL' 'NormalACoord'
    '0027' '1047' 'FL' 'NormalSCoord'
    '0027' '1060' 'FL' 'ImageDimensionX'
    '0027' '1061' 'FL' 'ImageDimensionY'
    '0027' '1062' 'FL' 'NumberOfExcitations'
    '0029' '1015' 'SL' 'LowerRangeOfPixels1'
    '0029' '1016' 'SL' 'UpperRangeOfPixels1'
    '0029' '1017' 'SL' 'LowerRangeOfPixels2'
    '0029' '1018' 'SL' 'UpperRangeOfPixels2'
    '0029' '1026' 'SS' 'VersionOfTheHdrStruct'
    '0029' '1034' 'SL' 'AdvantageCompOverflow'
    '0029' '1035' 'SL' 'AdvantageCompUnderflow'
    '0043' '1001' 'SS' 'BitmapOfPrescanOptions'
    '0043' '1002' 'SS' 'GradientOffsetInX'
    '0043' '1003' 'SS' 'GradientOffsetInY'
    '0043' '1004' 'SS' 'GradientOffsetInZ'
    '0043' '1006' 'SS' 'NumberOfEPIShots'
    '0043' '1007' 'SS' 'ViewsPerSegment'
    '0043' '1008' 'SS' 'RespiratoryRate'
    '0043' '1009' 'SS' 'RespiratoryTriggerPoint'
    '0043' '100A' 'SS' 'TypeOfReceiverUsed'
    '0043' '100B' 'DS' 'DB_dtPeakRateOfChangeOfGradientField'
    '0043' '100C' 'DS' 'dB_dtLimitsInUnitsOfPercent'
    '0043' '100D' 'DS' 'PSDEstimatedLimit'
    '0043' '100E' 'DS' 'PSDEstimatedLimitInTeslaPerSecond'
    '0043' '1010' 'SS' 'WindowValue'
    '0043' '101C' 'SS' 'GEImageIntegrity'
    '0043' '101D' 'SS' 'LevelValue'
    '0043' '100F' 'DS' 'Saravghead'
    '0043' '1028' 'OB' 'UniqueImageIden'
    '0043' '1029' 'OB' 'HistogramTables'
    '0043' '102A' 'OB' 'UserDefineData'
    '0043' '102B' 'SS' 'PrivateScanOptions'
    '0043' '102C' 'SS' 'EffectiveEchoSpacing'
    '0043' '102D' 'SH' 'FilterMode'
    '0043' '102F' 'SS' 'PrivateImageType'
    '0043' '1030' 'SS' 'VasCollapseFlag'
    '0043' '1032' 'SS' 'VasFlags'
    '0043' '1033' 'FL' 'Neg_scanspacing'
    '0043' '1034' 'IS' 'OffsetFrequency'
    '0043' '1035' 'UL' 'User_usage_tag'
    '0043' '1036' 'UL' 'User_fill_map_MSW'
    '0043' '1037' 'UL' 'User_fill_map_LSW'
    '0043' '1038' 'FL' 'UserData_25_48'
    '0043' '1039' 'IS' 'SlopInt_6_9'
    '0043' '1060' 'IS' 'SlopInt_10_17'
    '0043' '1061' 'UI' 'ScannerStudyEntityUID'
    '0043' '1062' 'SH' 'ScannerStudyID'
    '0043' '106F' 'DS' 'ScannerTableEntry'
    '0043' '1070' 'LO' 'ParadigmName'
    '0043' '1071' 'ST' 'ParadigmDescription'
    '0043' '1072' 'UI' 'ParadigmUID'
    '0043' '1073' 'US' 'ExperimentType'
    '0043' '1074' 'US' 'NumberOfRestVolumes'
    '0043' '1075' 'US' 'NumberOfActiveVolumes'
    '0043' '1076' 'US' 'NumberOfDummyScans'
    '0043' '1079' 'US' 'LocationsInAcquisition' % 'SlicesPerVolume'
    '0043' '107A' 'US' 'ExpectedTimePoints'
    '0043' '107B' 'FL' 'RegressorValues'
    '0043' '107C' 'FL' 'DelayAfterSliceGroup'
    '0043' '107D' 'US' 'ReconModeFlagWord'
    '0043' '1080' 'LO' 'CoilIDData'
    '0043' '1081' 'LO' 'GECoilName'
    '0043' '1082' 'LO' 'SystemConfigurationInformation'
    '0043' '1083' 'DS' 'AssetRFactors'
    '0043' '1084' 'LO' 'AdditionalAssetData'
    '0043' '1088' 'UI' 'PUREAcquisitionCalibrationSeriesUID'
    '0043' '1089' 'LO' 'GoverningBodydB_dtAndSARDefinition'
    '0043' '108A' 'CS' 'InPlanePhaseEncodingDirection'
    '0043' '108B' 'OB' 'FMRIBinaryDataBlock'
    '0043' '1090' 'LO' 'SARDefinition'
    '0043' '1091' 'DS' 'SARValue'
    '0043' '1095' 'LO' 'PrescanReuseString'
    '0043' '1096' 'CS' 'ContentQualification'
    '0043' '1097' 'LO' 'ImageFilteringParameters'
    '0043' '1098' 'UI' 'ASSETAcquisitionCalibrationSeriesUID'
    '0043' '109A' 'IS' 'RxStackIdentification'
    '0043' '10AA' 'LO' 'AdditionalFilteringParameters'
    '0043' '10B3' 'DS' 'AdvancedEddyCorrection' }];
    % SlopInt:
    % 6: b_value 7: private imaging options 2  8: ihtagging  9: ihtagspc
    % 10: ihfcineim  11: ihfcinent  12: Reserved  13: oprtarr
    % 14: averages  15: Current Station #  16: Total # of Stations
    % 17: private imaging options 3

    % ScannerTableEntry:
    % 1: table entry, 2: table swing angle, 3: table lateral offset,
    % 4: gradient coil selected (multiple gradient systems only)
elseif strncmpi(vendor, 'Philips', 7)
    C = [C; {
    '2001' '1001' 'FL' 'ChemicalShift'
    '2001' '1002' 'IS' 'ChemicalShiftNumberMR'
    '2001' '1003' 'FL' 'B_factor'
    '2001' '1004' 'CS' 'DiffusionDirection'
    '2001' '1006' 'CS' 'ImageEnhanced'
    '2001' '1007' 'CS' 'ImageTypeEDES'
    '2001' '1008' 'IS' 'PhaseNumber'
    '2001' '1009' 'FL' 'ImagePrepulseDelay'
    '2001' '100A' 'IS' 'SliceNumberMR'
    '2001' '100B' 'CS' 'SliceOrientation'
    '2001' '100C' 'CS' 'ArrhythmiaRejection'
    '2001' '100E' 'CS' 'CardiacCycled'
    '2001' '100F' 'SS' 'CardiacGateWidth'
    '2001' '1010' 'CS' 'CardiacSync'
    '2001' '1011' 'FL' 'DiffusionEchoTime'
    '2001' '1012' 'CS' 'DynamicSeries'
    '2001' '1013' 'SL' 'EPIFactor'
    '2001' '1014' 'SL' 'NumberOfEchoes'
    '2001' '1015' 'SS' 'NumberOfLocations'
    '2001' '1016' 'SS' 'NumberOfPCDirections'
    '2001' '1017' 'SL' 'NumberOfPhasesMR'
    '2001' '1018' 'SL' 'LocationsInAcquisition'  % 'NumberOfSlicesMR'
    '2001' '1019' 'CS' 'PartialMatrixScanned'
    '2001' '101A' 'FL' 'PCVelocity'
    '2001' '101B' 'FL' 'PrepulseDelay'
    '2001' '101C' 'CS' 'PrepulseType'
    '2001' '101D' 'IS' 'ReconstructionNumberMR'
    '2001' '101F' 'CS' 'RespirationSync'
    '2001' '1020' 'LO' 'ScanningSequence' % ScanningTechnique
    '2001' '1021' 'CS' 'SPIR'
    '2001' '1022' 'FL' 'WaterFatShift'
    '2001' '1023' 'DS' 'MRSeriesFlipAngle' % duplicate
    '2001' '1024' 'CS' 'SeriesIsInteractive'
    '2001' '1025' 'SH' 'EchoTimeDisplay'
    '2001' '102D' 'SS' 'StackNumberOfSlices'
    '2001' '1032' 'FL' 'StackRadialAngle'
    '2001' '1033' 'CS' 'StackRadialAxis'
    '2001' '1035' 'SS' 'StackSliceNumber'
    '2001' '1036' 'CS' 'StackType'
	'2001' '103F' 'CS' 'DisplayedAreaZoomInterpolationMeth'
    '2001' '105F' 'SQ' 'Stack'
    '2001' '1060' 'SL' 'NumberOfStacks'
    '2001' '1061' 'CS' 'SeriesTransmitted'
    '2001' '1062' 'CS' 'SeriesCommitted'
    '2001' '1063' 'CS' 'ExaminationSource'
    '2001' '106E' 'SH' 'SeriesType'
    '2001' '107B' 'IS' 'MRSeriesAcquisitionNumber'
    '2001' '1081' 'IS' 'NumberOfDynamicScans'
    '2001' '1082' 'IS' 'MRSeriesEchoTrainLength' % duplicate
    '2001' '1083' 'DS' 'MRSeriesImagingFrequency' % duplicate
    '2001' '1084' 'DS' 'MRSeriesInversionTime' % duplicate
    '2001' '1085' 'DS' 'MRSeriesMagneticFieldStrength' % duplicate, seems wrong
    '2001' '1086' 'IS' 'MRSeriesNrOfPhaseEncodingSteps' % duplicate, seems wrong
    '2001' '1087' 'SH' 'MRSeriesNucleus' % duplicate
    '2001' '1088' 'DS' 'MRSeriesNumberOfAverages' % duplicate
    '2001' '1089' 'DS' 'MRSeriesPercentPhaseFieldOfView' % duplicate, wrong
    '2001' '108A' 'DS' 'MRSeriesPercentSampling' % duplicate, wrong
    '2001' '108B' 'SH' 'MRSeriesTransmittingCoil' % duplicate
    '2001' '10C8' 'LO' 'ExamCardName'
    '2001' '10F1' 'FL' 'ProspectiveMotionCorrection'
    '2001' '10F2' 'FL' 'RetrospectiveMotionCorrection'
    '2001' '1068' 'CQ' 'LinearModalityGLTrafo'
    '2001' '1077' 'CS' 'GLTrafoType'
    '2001' '9000' 'SQ' 'PresentationStateSequence'
    '2005' '1000' 'FL' 'MRImageAngulationAP'
    '2005' '1001' 'FL' 'MRImageAngulationFH'
    '2005' '1002' 'FL' 'MRImageAngulationRL'
    '2005' '1004' 'CS' 'MRImageDisplayOrientation'
    '2005' '1008' 'FL' 'MRImageOffCentreAP'
    '2005' '1009' 'FL' 'MRImageOffCentreFH'
    '2005' '100A' 'FL' 'MRImageOffCentreRL'
    '2005' '100B' 'FL' 'MRMaxFP'
    '2005' '100C' 'FL' 'MRMinFP'
    '2005' '100D' 'FL' 'MRScaleIntercept'
    '2005' '100E' 'FL' 'MRScaleSlope'
    '2005' '100F' 'DS' 'WindowCenterOriginal'
    '2005' '1010' 'DS' 'WindowWidthOriginal'
    '2005' '1011' 'CS' 'MRImageTypeMR'
    '2005' '1012' 'CS' 'MRCardiacGating'
    '2005' '1013' 'CS' 'MRSeriesDevelopmentMode'
    '2005' '1014' 'CS' 'MRSeriesDiffusion'
    '2005' '1015' 'CS' 'MRFatSaturationTechnique'
    '2005' '1016' 'CS' 'MRFlowCompensation'
    '2005' '1017' 'CS' 'MRFourierInterpolation'
    '2005' '1019' 'CS' 'MRInverseReconstructed'
    '2005' '101A' 'SS' 'MRLabelSyntax'
    '2005' '101B' 'CS' 'MRMagnetiPrepared'
    '2005' '101C' 'CS' 'MRMagnetTransferConst'
    '2005' '101D' 'SS' 'MRMeasurementScanResolution'
    '2005' '101E' 'SH' 'MIPProtocol'
    '2005' '101F' 'SH' 'MPRProtocol'
    '2005' '1020' 'SL' 'NumberOfChemicalShift'
    '2005' '1021' 'SS' 'MRNumberOfMixes'
    '2005' '1022' 'IS' 'MRNumberOfReferences'
    '2005' '1023' 'SS' 'MRNumberOfSlabs'
    '2005' '1025' 'SS' 'MRNumberOfVolumes'
    '2005' '1026' 'CS' 'MROverSampleingPhase'
    '2005' '1027' 'CS' 'MRPackageMode'
    '2005' '1028' 'CS' 'MRPartialFourierFrequency'
    '2005' '1029' 'CS' 'MRPartialFourierPhase'
    '2005' '102A' 'IS' 'MRPatientReferenceID'
    '2005' '102B' 'SS' 'MRPercentScanComplete'
    '2005' '102C' 'CS' 'MRPhaseEncodedRecording'
    '2005' '102D' 'IS' 'MRPlanScanSurveyNumberOfImages'
    '2005' '102E' 'CS' 'MRPPGPPUGating'
    '2005' '102F' 'CS' 'MRSpatialPresaturation'
    '2005' '1030' 'FL' 'MRSeriesRepetitionTime' % duplicate
    '2005' '1031' 'CS' 'MRRespiratoryGating'
    '2005' '1033' 'FL' 'MRSeriesScanDuration'
    '2005' '1034' 'CS' 'MRSegmentedKSpace'
    '2005' '1035' 'CS' 'MRSeriesDataType'
    '2005' '1036' 'CS' 'MRSeriesIsCardiac'
    '2005' '1037' 'CS' 'MRSeriesIsSpectro'
    '2005' '1038' 'CS' 'MRSpoiled'
    '2005' '1039' 'CS' 'MRSteadyState'
    '2005' '103A' 'SH' 'MRSubAnatomy'
    '2005' '103B' 'CS' 'MRTimeReversedSteadyState'
    '2005' '103C' 'CS' 'MRSeriesTone'
    '2005' '103D' 'SS' 'MRNumberOfRRIntervalRanges'
    '2005' '103E' 'SL' 'MRRRIntervalsDistribution'
    '2005' '103F' 'SL' 'MRPlanScanAcquisitionNo'
    '2005' '1040' 'SL' 'MRChemicalShiftNo'
    '2005' '1041' 'SL' 'MRPlanScanDynamicScanNo'
    '2005' '1042' 'SL' 'MRPlanScanSurveyEchoNo'
    '2005' '1043' 'CS' 'MRPlanScanImageType'
    '2005' '1044' 'SL' 'MRPlanScanPhaseNo'
    '2005' '1045' 'SL' 'MRPlanScanReconstructionNo'
    '2005' '1046' 'CS' 'MRPlanScanScanningSequence'
    '2005' '1047' 'SL' 'MRPlanScanSliceNo'
    '2005' '1054' 'FL' 'MRVolumeAngulationAP'
    '2005' '1055' 'FL' 'MRVolumeAngulationFH'
    '2005' '1056' 'FL' 'MRVolumeAngulationRL'
    '2005' '1057' 'FL' 'MRVolumeFovAP'
    '2005' '1058' 'FL' 'MRVolumeFovFH'
    '2005' '1059' 'FL' 'MRVolumeFovRL'
    '2005' '105A' 'FL' 'MRVolumeOffcentreAP'
    '2005' '105B' 'FL' 'MRVolumeOffcentreFH'
    '2005' '105C' 'FL' 'MRVolumeOffcentreRL'
    '2005' '105D' 'CS' 'MRVolumeType'
    '2005' '105E' 'CS' 'MRVolumeViewAxis'
    '2005' '105F' 'CS' 'MRStudyOrigin'
    '2005' '1060' 'IS' 'MRStudySequenceNumber'
    '2005' '1061' 'CS' 'MRImagePrepulseType'
    '2005' '1063' 'SS' 'MRfMRIStatusIndication'
    '2005' '106E' 'CS' 'MRImageScanningSequencePrivate'
    '2005' '106F' 'CS' 'MRAcquisitionType' % 'MRSeriesAcquisitionTypePrivate'
    '2005' '1071' 'FL' 'MRStackAngulationAP'
    '2005' '1072' 'FL' 'MRStackAngulationFH'
    '2005' '1073' 'FL' 'MRStackAngulationRL'
    '2005' '1074' 'FL' 'MRStackFovAP'
    '2005' '1075' 'FL' 'MRStackFovFH'
    '2005' '1076' 'FL' 'MRStackFovRL'
    '2005' '1078' 'FL' 'MRStackOffcentreAP'
    '2005' '1079' 'FL' 'MRStackOffcentreFH'
    '2005' '107A' 'FL' 'MRStackOffcentreRL'
    '2005' '107B' 'CS' 'MRStackPreparationDirection'
    '2005' '107E' 'FL' 'MRStackSliceDistance'
    '2005' '1080' 'SQ' 'SeriesPlanScan'
    '2005' '1081' 'CS' 'MRStackViewAxis'
    '2005' '1083' 'SQ' 'SeriesSlab'
    '2005' '1084' 'SQ' 'SeriesReference'
    '2005' '1085' 'SQ' 'SeriesVolume'
    '2005' '1086' 'SS' 'MRNumberOfGeometry'
    '2005' '109E' 'SQ' 'SeriesGeom'
    '2005' '109F' 'CS' 'MRSeriesSpectralSelectiveExcitationPulse'
    '2005' '10A0' 'FL' 'MRImageDynamicScanBeginTime'
    '2005' '10A1' 'CS' 'SyncraScanType'
    '2005' '10A2' 'CS' 'MRIsCOCA'
    '2005' '10A3' 'IS' 'MRStackCoilID'
    '2005' '10A4' 'IS' 'MRStackCBBCoil1'
    '2005' '10A5' 'IS' 'MRStackCBBCoil2'
    '2005' '10A6' 'IS' 'MRStackChannelCombi'
    '2005' '10A7' 'CS' 'MRStackCoilConn'
    '2005' '10A8' 'DS' 'MRPrivateInversionTime'
    '2005' '10A9' 'CS' 'MRSeriesGeometryCorrection'
    '2005' '10B0' 'FL' 'DiffusionDirectionX' % degrees
    '2005' '10B1' 'FL' 'DiffusionDirectionY'
    '2005' '10B2' 'FL' 'DiffusionDirectionZ'
    '2005' '10C0' 'CS' 'SequenceVariant' % 'SeriesScanSequence' % duplicate
    '2005' '1132' 'SQ' 'MRBlobDataObjectArray'
    '2005' '1134' 'LT' 'SeriesTransactionUID'
    '2005' '1137' 'PN' 'MRBlobName'
%     '2005' '1138' 'PN' 'MRApplicationName'
    '2005' '1139' 'PN' 'MRTypeName'
%     '2005' '1140' 'PN' 'MRVersionStr'
%     '2005' '1141' 'PN' 'MRCommentStr'
%     '2005' '1142' 'CS' 'BlobInFile'
    '2005' '1143' 'SL' 'MRActualBlobSize'
    '2005' '1144' 'OW' 'MRBlobData'
    '2005' '1145' 'PN' 'BlobFilename'
%     '2005' '1146' 'SL' 'BlobOffset'
    '2005' '1147' 'CS' 'MRBlobFlag'
    '2005' '1199' 'UL' 'MRNumberOfRequestExcerpts'
    '2005' '1200' 'UL' 'MRNumberOfSOPCommon'
    '2005' '1201' 'UL' 'MRNoOfFilmConsumption'
    '2005' '1213' 'UL' 'MRNumberOfCodes'
    '2005' '1234' 'SL' 'MRNumberOfImagePerSeriesRef'
	'2005' '1257' 'SS' 'MRNrRunningAttributes'
    '2005' '1243' 'SS' 'MRNoDateOfLastCalibration'
    '2005' '1244' 'SS' 'MRNoTimeOfLastCalibration'
    '2005' '1245' 'SS' 'MRNrOfSoftwareVersion'
    '2005' '1247' 'SS' 'MRNrOfPatientOtherNames'
    '2005' '1248' 'SS' 'MRNrOfReqRecipeOfResults'
    '2005' '1249' 'SS' 'MRNrOfSeriesOperatorsName'
    '2005' '1250' 'SS' 'MRNrOfSeriesPerfPhysiName'
    '2005' '1251' 'SS' 'MRNrOfStudyAdmittingDiagnosticDescr'
    '2005' '1252' 'SS' 'MRNrOfStudyPatientContrastAllergies'
    '2005' '1253' 'SS' 'MRNrOfStudyPatientMedicalAlerts'
    '2005' '1254' 'SS' 'MRNrOfStudyPhysiciansOfRecord'
    '2005' '1255' 'SS' 'MRNrOfStudyPhysiReadingStudy'
    '2005' '1256' 'SS' 'MRNrSCSoftwareVersions'
    '2005' '1325' 'CS' 'MRSpectroSIB0Correction'
    '2005' '1326' 'FL' 'MRSpectroB0EchoTopPosition'
    '2005' '1327' 'CS' 'MRSpectroComplexComponent'
    '2005' '1328' 'CS' 'MRSpectroDataOrigin'
    '2005' '1329' 'FL' 'MRSpectroEchoTopPosition'
    '2005' '1330' 'CS' 'MRInPlaneTransforms'
    '2005' '1331' 'SS' 'MRNumberOfSpectraAcquired'
    '2005' '1333' 'FL' 'MRPhaseEncodingEchoTopPositions'
    '2005' '1334' 'CS' 'MRPhysicalQuantityForChemicalShift'
    '2005' '1335' 'CS' 'MRPhysicalQuantitySpatial'
    '2005' '1336' 'FL' 'MRReferenceFrequency'
    '2005' '1337' 'FL' 'MRSampleOffset'
    '2005' '1338' 'FL' 'MRSamplePitch'
    '2005' '1339' 'SS' 'MRSearchIntervalForPeaks'
    '2005' '1340' 'CS' 'MRSignalDomainForChemicalShift'
    '2005' '1341' 'CS' 'MRSignalDomainSpatial'
    '2005' '1342' 'CS' 'MRSignalType'
    '2005' '1343' 'CS' 'MRSpectroAdditionalRotations'
    '2005' '1344' 'SS' 'MRSpectroDisplayRanges'
    '2005' '1345' 'CS' 'MRSpectroEchoAcquisition'
    '2005' '1346' 'CS' 'MRSpectroFrequencyUnit'
    '2005' '1347' 'FL' 'MRSpectroGamma'
    '2005' '1348' 'CS' 'MRSpectroHiddenLineRemoval'
    '2005' '1349' 'FL' 'MRSpectroHorizontalShift'
    '2005' '1350' 'FL' 'MRSpectroHorizontalWindow'
    '2005' '1351' 'SS' 'MRSpectroNumberOfDisplayRanges'
    '2005' '1352' 'SS' 'MRSpectroNumberOfEchoPulses'
    '2005' '1353' 'LO' 'MRSpectroProcessingHistory'
    '2005' '1354' 'CS' 'MRSpectroScanType'
    '2005' '1355' 'FL' 'MRSpectroSICSIntervals'
    '2005' '1356' 'CS' 'MRSpectroSIMode'
    '2005' '1357' 'SS' 'MRSpectroSpectralBW'
    '2005' '1358' 'LO' 'MRSpectroTitleLine'
    '2005' '1359' 'FL' 'MRSpectroTurboEchoSpacing'
    '2005' '1360' 'FL' 'MRSpectroVerticalShift'
    '2005' '1361' 'FL' 'MRSpectroVerticalWindow'
    '2005' '1362' 'FL' 'MRSpectroOffset'
    '2005' '1363' 'FL' 'MRSpectrumPitch'
    '2005' '1364' 'CS' 'MRVolumeSelection'
    '2005' '1370' 'SS' 'MRNoMixesSpectro'
    '2005' '1371' 'SQ' 'MRSeriesSPMix'
    '2005' '1381' 'IS' 'MRScanoGramSurveyNumberOfImages'
    '2005' '1382' 'UL' 'MRNumberOfProcedureCodes'
    '2005' '1389' 'SQ' 'ViewingProtocol'
    '2005' '1390' 'CS' 'MRStackCoilFunction'
    '2005' '1392' 'IS' 'MRGeolinkID'
    '2005' '1393' 'IS' 'MRStationNo'
    '2005' '1395' 'UI' 'ViewProcedureString'
    '2005' '1396' 'CS' 'MRFlowImagesPresent'
    '2005' '1397' 'LO' 'AnatomicRegCodeValue'
    '2005' '1398' 'CS' 'MRMobiviewEnabled'
    '2005' '1399' 'CS' 'MRIViewBoldEnabled'
    '2005' '1400' 'CS' 'MRVolumeViewEnabled'
    '2005' '1401' 'UL' 'MRNumberOfStudyReference'
    '2005' '1402' 'SQ' 'SPSCode'
    '2005' '1403' 'UL' 'MRNumberOfSPSCodes'
    '2005' '1407' 'SS' 'MRNrOfSpecificCharacterSet'
    '2005' '1409' 'DS' 'RescaleInterceptOriginal'
    '2005' '140A' 'DS' 'RescaleSlopeOriginal'
    '2005' '140B' 'LO' 'RescaleTypeOriginal'
    '2005' '140E' 'SQ' 'PrivateSharedSq'
    '2005' '140F' 'SQ' 'PrivatePerFrameSq'
    '2005' '1410' 'IS' 'MFConvTreatSpectorMixNo'
    '2005' '1411' 'UI' 'MFPrivateReferencedSOPInstanceUID'
    '2005' '1412' 'IS' 'MRImageDiffBValueNumber'
    '2005' '1413' 'IS' 'MRImageGradientOrientationNumber'
    '2005' '1414' 'SL' 'MRSeriesNrOfDiffBValues'
    '2005' '1415' 'SL' 'MRSeriesNrOfDiffGradOrients'
    '2005' '1416' 'CS' 'MRSeriesPlanMode'
    '2005' '1417' 'FD' 'B_matrix' % DiffusionBMatrix
    '2005' '1418' 'CS' 'PrivOperatingModeType'
    '2005' '1419' 'CS' 'PrivOperatingMode'
    '2005' '141A' 'CS' 'MRFatSaturationTechnique'
    '2005' '141B' 'IS' 'MRVersionNumberDeletedImages'
    '2005' '141C' 'IS' 'MRVersionNumberDeletedSpectra'
    '2005' '141D' 'IS' 'MRVersionNumberDeletedBlobsets'
    '2005' '1426' 'CS' 'ViewingHardcopyOnly'
    '2005' '1428' 'SL' 'MRSeriesNrOfLabelTypes'
    '2005' '142A' 'CS' 'ExamPrintStatus'
    '2005' '142B' 'CS' 'ExamExportStatus'
    '2005' '142C' 'CS' 'ExamStorageCommitStatus'
    '2005' '142D' 'CS' 'ExamMediaWriteStatus'
    '2005' '142E' 'FL' 'MRSeriesDBdt'
    '2005' '142F' 'FL' 'MRSeriesProtonSAR'
    '2005' '1430' 'FL' 'MRSeriesNonProtonSAR'
    '2005' '1431' 'FL' 'MRSeriesLocalSAR'
    '2005' '1432' 'CS' 'MRSeriesSafetyOverrideMode'
    '2005' '1435' 'CS' 'SpectroExamcard'
    '2005' '143A' 'LT' 'DataDictionaryContentsVersion'
    '2005' '143B' 'CS' 'MRIsCoilSurvey'
    '2005' '143C' 'FL' 'MRStackTablePosLong'
    '2005' '143D' 'FL' 'MRStackTablePosLat'
    '2005' '143E' 'FL' 'MRStackPosteriorCoilPos'
    '2005' '143F' 'CS' 'AIMDLimitsApplied'
    '2005' '1440' 'FL' 'AIMDHeadSARLimit'
    '2005' '1441' 'FL' 'AIMDWholeBodySARLimit'
    '2005' '1442' 'FL' 'AIMDB1RMSLimit'
    '2005' '1443' 'FL' 'AIMDdbDtLimit'
    '2005' '1444' 'IS' 'TFEFactor'
    '2005' '1445' 'CS' 'AttenuationCorrection'
    '2005' '1446' 'FL' 'FWHMShim'
    '2005' '1447' 'FL' 'PowerOptimization'
    '2005' '1448' 'FL' 'CoilQ'
    '2005' '144A' 'FL' 'DataWindowDuration'
    '2005' '144B' 'FL' 'MixingTime'
    '2005' '144C' 'FL' 'FirstEchoTime'
    '2005' '144D' 'CS' 'IsB0Series'
    '2005' '144E' 'CS' 'IsB1Series'
    '2005' '144F' 'CS' 'VolumeSelect'
    '2005' '1450' 'SS' 'MRNrOfPatientOtherIDs'
    '2005' '1455' 'FD' 'ImageVelocityEncodingDirection'
    '2005' '1492' 'FL' 'SpecificEnergyDose'
    '2005' '1553' 'FL' 'MREFrequency'
    '2005' '1554' 'FL' 'MREAmplitude'
    '2005' '1555' 'FL' 'MREMEGFrequency'
    '2005' '1556' 'FL' 'MREMEGPairs'
    '2005' '1557' 'CS' 'MREMEGDirection'
    '2005' '1558' 'FL' 'MREMEGAmplitude'
    '2005' '1559' 'FL' 'MRENumberofPhaseDelays'
    '2005' '1560' 'IS' 'MRENumberofMotionCycles'
    '2005' '1561' 'FL' 'MREMotionMegPhaseDelay'
    '2005' '1562' 'LT' 'MREInversionAlgorithmVersion'
    '2005' '1568' 'IS' 'MREPhaseDelayNumber'
    '2005' '1563' 'CS' 'SagittalSliceOrder'
    '2005' '1564' 'CS' 'CoronalSliceOrder'
    '2005' '1565' 'CS' 'TransversalSliceOrder'
    '2005' '1566' 'CS' 'SeriesOrientation'
    '2005' '1567' 'IS' 'MRStackReverse'
    '2005' '1579' 'CS' 'OrientationMirrorFlip'
    '2005' '1571' 'IS' 'NumberOfInversionDelays'
    '2005' '1572' 'FL' 'InversionDelayTime'
    '2005' '1573' 'IS' 'InversionDelayNumber'
    '2005' '1574' 'DS' 'MaxDBDT'
    '2005' '1575' 'DS' 'MaxSAR'
    '2005' '1576' 'LT' 'SARType'
    '2005' '1578' 'CS' 'MetalImplantStatus'
    '2005' '1581' 'CS' 'SAROperationMode'
    '2005' '1582' 'IS' 'SpatialGradient'
    '2005' '1583' 'LT' 'AdditionalConstraints'
    '2005' '1585' 'DS' 'PIIM_GRADIENT_SLEW_RATE'
    '2005' '1587' 'DS' 'PIIM_MR_STUDY_B1RMS'
    '2050' '0020' 'CS' 'PresentationLUTShape' }];
elseif strncmpi(vendor, 'UIH', 3)
    C = [C; {
    '0061' '1002' 'US' 'GeneratePrivate'
    '0061' '4002' 'SH' 'FOV'
    '0065' '1000' 'UL' 'MeasurmentUID'
    '0065' '1002' 'SH' 'ImageOrientationDisplayed'
    '0065' '1003' 'LO' 'ReceiveCoil'
    '0065' '1004' 'SH' 'Interpolation'
    '0065' '1005' 'SH' 'PEDirectionDisplayed'
    '0065' '1006' 'IS' 'SliceGroupID'
    '0065' '1007' 'OB' 'Uprotocol'
    '0065' '1009' 'FD' 'B_value' % 'BActualValue'
    '0065' '100A' 'FD' 'BUserValue'
    '0065' '100B' 'DS' 'BlockSize'
    '0065' '100C' 'SH' 'ExperimentalStatus'
    '0065' '100D' 'SH' 'ParallelInformation'
    '0065' '100F' 'SH' 'SlicePosition'
    '0065' '1011' 'SH' 'Sections'
    '0065' '1013' 'FD' 'InPlaneRotAngle'
    '0065' '1014' 'DS' 'SliceNormalVector'
    '0065' '1015' 'DS' 'SliceCenterPosition'
    '0065' '1016' 'UL' 'PixelRotateModel'
    '0065' '1017' 'LO' 'SARModel'
    '0065' '1018' 'LO' 'dBdtModel'
    '0065' '1023' 'LO' 'TablePosition'
    '0065' '1025' 'DS' 'SliceGap'
    '0065' '1029' 'SH' 'AcquisitionDurationUIH'
    '0065' '102B' 'LT' 'ApplicationCategory'
    '0065' '102C' 'IS' 'RepeatitionIndex'
    '0065' '102D' 'ST' 'SequenceDisplayName'
    '0065' '102E' 'LO' 'NoiseDecovarFlag'
    '0065' '102F' 'FL' 'ScaleFactor'
    '0065' '1031' 'SH' 'MRSequenceVariant'
    '0065' '1032' 'SH' 'MRKSpaceFilter'
    '0065' '1033' 'SH' 'MRTableMode'
    '0065' '1036' 'OB' 'MRDiscoParameter'
    '0065' '1037' 'FD' 'MRDiffusionGradOrientation'
    '0065' '1038' 'FD' 'MRPerfusionNoiseLevel'
    '0065' '1039' 'SH' 'MRGradRange'
    '0065' '1050' 'DS' 'LocationsInAcquisition' % MRNumberOfSliceInVolume
    '0065' '1051' 'SQ' 'MRVFrameSequence'}];
% elseif strncmpi(vendor, 'OtherVendor', n)
%     C = [C; {}];
end

dict.group = uint16(hex2dec(C(:,1)));
dict.element = uint16(hex2dec(C(:,2)));
dict.tag = uint32(dict.group) * 65536 + uint32(dict.element);
dict.vr = C(:,3); % for implicit VR and some problematic explicit VR
dict.name = C(:,4);

if nargin>1 && ~isempty(flds) % use only provided fields
    flds = cellstr(flds);
    ind = false(size(dict.tag,1), 1);
    for i = 1:numel(flds)
        ind = ind | strcmp(flds{i}, dict.name); % include duplicate
    end
    dict.fields = flds; % remember the requested fields
    dict.tag  = dict.tag(ind);
    dict.vr   = dict.vr(ind);
    dict.name = dict.name(ind);
    dict.group = dict.group(ind);
    dict.element = dict.element(ind);
end

[dict.tag, ind] = unique(dict.tag); % sort by tag
dict.vr = dict.vr(ind);
dict.name = dict.name(ind);
dict.group = dict.group(ind);
dict.element = dict.element(ind);

author: qMRLab

repo: qMRLab

save_path: github-repos/MATLAB/qMRLab-qMRLab


text:
function scatter3sph(X,Y,Z,varargin)
%SCATTER3SPH (X,Y,Z) Plots a 3d scatter plot with 3D spheres
%	SCATTER3SPH is like scatter3 only drawing spheres with volume, instead
%	of flat circles, at coordinates specified by vectors X, Y, Z. All three
%	vectors have to be of the same length.
%	SCATTER3SPH(X,Y,Z) draws the spheres with the default size and color.
%	SCATTER3SPH(X,Y,Z,'size',S) draws the spheres with sizes S. If length(S)= 1
%	the same size is used for all spheres.
%	SCATTER3SPH(X,Y,Z,'color',C) draws the spheres with colors speciffied in a
%	N-by-3 matrix C as RGB values.
%	Parameter names can be abreviated to 3 letters. For example: 'siz' or
%	'col'. Case is irrelevant.
%
% Example
% %Coordinates
%  X= 100*rand(9,1); Y= 100*rand(9,1); Z= 100*rand(9,1);
%
% %Colors: 3 blue, 3 red and 3 green
% C= ones(3,1)*[0 0 1];
% C= [C;ones(3,1)*[1 0 0]];
% C= [C;ones(3,1)*[0 1 0]];
%
% %Spheres sizes
% S= 5+10*rand(9,1);
%
% figure(1);
% scatter3sph(X,Y,Z,'size',S,'color',C);
% axis equal
% axis tight
% view(125,20);
% grid ON

%-- Some checking...
if nargin < 3 error('Need at least three arguments'); return; end
if mean([length(X),length(Y),length(Z)]) ~= length(X) error ('Imput vectors X, Y, Z are of different lengths'); return; end

%-- Defaults
C= ones(length(X),1)*[0 0 1];
S= 0.1*max([X;Y;Z])*ones(length(X),1);

%-- Extract optional arguments
for j= 1:2:length(varargin)
	string= lower(varargin{j});
	switch string(1:min(3,length(string)))
		case 'siz'
			S= varargin{j+1};
			if length(S) == 1
				S= ones(length(X),1)*S;
			elseif length(S) < length(X)
				error('The vector of sizes must be of the same length as coordinate vectors (or 1)');
				return
			end

		case 'col'
			C= varargin{j+1};
			if size(C,2) < 3	error('Colors matrix must have 3 columns'); return; end
			if size(C,1) == 1
				C= ones(length(X),1)*C(1:3);
			elseif size(C,1) < length(X)
				error('Colors matrix must have the same number of rows as length of coordinate vectors (or 1)');
				return
			end

		otherwise
			error('Unknown parameter name. Allowed names: ''size'', ''color'' ');
	end
end

%-- Sphere facets
[sx,sy,sz]= sphere(20);

%-- Plot spheres
hold on
for j= 1:length(X)
	surf(sx*S(j)+X(j), sy*S(j)+Y(j), sz*S(j)+Z(j),...
		'LineStyle','none',...
		'AmbientStrength',0.4,...
		'FaceColor',C(j,:),...
		'SpecularStrength',0.8,...
		'DiffuseStrength',1,...
		'FaceAlpha',0.65,...
		'SpecularExponent',2);
end
light('Position',[0 0 1],'Style','infinit','Color',[1 1 1]);
lighting gouraud
view(30,15)

author: Sable

repo: mcbench-benchmarks


text:
function [ vX ] = EstimateSignalSamples( vX, vH, vY, convShape, paramLambda, hSumLogProb )
% ----------------------------------------------------------------------------------------------- %
% [ mK ] = CreateConvMtx1D( vK, numElements, convShape )
% Generates a Convolution Matrix for 1D Kernel (The Vector vK) with
% support for different convolution shapes (Full / Same / Valid). The
% matrix is build such that for a signal 'vS' with 'numElements = size(vS
% ,1)' the following are equiavlent: 'mK * vS' and conv(vS, vK,
% convShapeString);
% Input:
%   - vK                -   Input 1D Convolution Kernel.
%                           Structure: Vector.
%                           Type: 'Single' / 'Double'.
%                           Range: (-inf, inf).
%   - numElements       -   Number of Elements.
%                           Number of elements of the vector to be
%                           convolved with the matrix. Basically set the
%                           number of columns of the Convolution Matrix.
%                           Structure: Scalar.
%                           Type: 'Single' / 'Double'.
%                           Range: {1, 2, 3, ...}.
%   - convShape         -   Convolution Shape.
%                           The shape of the convolution which the output
%                           convolution matrix should represent. The
%                           options should match MATLAB's conv2() function
%                           - Full / Same / Valid.
%                           Structure: Scalar.
%                           Type: 'Single' / 'Double'.
%                           Range: {1, 2, 3}.
% Output:
%   - mK                -   Convolution Matrix.
%                           The output convolution matrix. The product of
%                           'mK' and a vector 'vS' ('mK * vS') is the
%                           convolution between 'vK' and 'vS' with the
%                           corresponding convolution shape.
%                           Structure: Matrix (Sparse).
%                           Type: 'Single' / 'Double'.
%                           Range: (-inf, inf).
% References:
%   1.  MATLAB's 'convmtx()' - https://www.mathworks.com/help/signal/ref/convmtx.html.
% Remarks:
%   1.  The output matrix is sparse data type in order to make the
%       multiplication by vectors to more efficient.
%   2.  In caes the same convolution is applied on many vectors, stacking
%       them into a matrix (Each signal as a vector) and applying
%       convolution on each column by matrix multiplication might be more
%       efficient than applying classic convolution per column.
% TODO:
%   1.
%   Release Notes:
%   -   1.0.000     20/01/2019  Royi Avital
%       *   First release version.
% ----------------------------------------------------------------------------------------------- %

CONVOLUTION_SHAPE_FULL         = 1;
CONVOLUTION_SHAPE_SAME         = 2;
CONVOLUTION_SHAPE_VALID        = 3;

switch(convShape)
    case(CONVOLUTION_SHAPE_FULL)
        convShapeString = 'full';
    case(CONVOLUTION_SHAPE_SAME)
        convShapeString = 'same';
    case(CONVOLUTION_SHAPE_VALID)
        convShapeString = 'valid';
end

vXX = vX;

hObjFun = @(vX) 0.5 * sum((conv(vX, vH, convShapeString) - vY) .^ 2) - (paramLambda * hSumLogProb(vX));

vX = fminunc(hObjFun, vX);

end

author: RoyiAvital

repo: StackExchangeCodes


text:
function lambda = gk316_eigenvalues ( n )

%*****************************************************************************80
%
%% GK316_EIGENVALUES returns the eigenvalues of GK316.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    09 October 2007
%
%  Author:
%
%    John Burkardt
%
%  Parameters:
%
%    Input, integer N, the order of A.
%
%    Output, real LAMBDA(N,1), the eigenvalues.
%
  lambda = zeros ( n, 1 );

  if ( n == 1 )

    lambda(1,1) = 1.0;

  else

    lambda(1:n-2,1) = 1.0;

    a = 1.0;
    b = - ( n + 1 );
    c = - ( n * ( n + 1 ) * ( 2 * n - 5 ) ) / 6.0;

    lambda(n-1,1) = ( - b + sqrt ( b * b - 4.0 * a * c ) ) / ( 2.0 * a );
    lambda(n,1) =   ( - b - sqrt ( b * b - 4.0 * a * c ) ) / ( 2.0 * a );

  end

  return
end


text:
data = 'lobby.mat';
% 'mall.mat'
% 'yaleB02.mat'
% 'lobby.mat'
% 'hall.mat'
fprintf('--------------------------------\n')
fprintf(strcat(data, ' experiment', ' has started! \n'))
path = strcat('..\FW_SPCP\data\',data);
load(path);
[m n] = size(D);
D = D/norm(D,'fro');

%% parameter tuning
rho = 0.5;  % sampling ratio
Omega = rand(m,n)<=rho; % support of observation
obs = Omega.*D; % measurements

delta = 0.01;
% this is parameter to control noise level
% the smaller the noise, the smaller is delta

lambda_1 = delta*rho*norm(obs,'fro');
lambda_2 = delta*sqrt(rho)*norm(obs,'fro')/sqrt(max(m,n));

% compare or not
compare = 1;

par.M = obs;
par.lambda_1 = lambda_1; par.lambda_2 =lambda_2;
par.iter = 1000; par.display = 1; par.rho = rho;
par.epsilon = 10^-3; % stopping criterion
par.method = 'exact';%'exact' or 'power'
par.Omega = Omega;
par.compare = compare; % make comparison or not
output = FW_T(par); % main function

% obtain the objective value returned from FW-T
L = output.L; S = output.S;
obj = 0.5*norm(Omega.*(L+S-obs),'fro')^2 + lambda_1*sum(svd(L))+...
    lambda_2*norm(vec(S),1);

if compare % make comparison with FISTA and ISTA
    par.obj = obj;
    fprintf('the objective value returned by FW-T is %d \n', obj)
    tic
    fprintf('--------------------------------\n')
    fprintf('fista is invoked! \n')
    fista(par);
    toc
    tic
    fprintf('--------------------------------\n')
    fprintf('ista is invoked! \n')
    ista(par);
    toc
end
% plot objective values
figure();
plot(output.hist(1:end));
xlabel('iter.'); ylabel('obj. value');
title('obj. values produced by FW-T');

% original video
toplay = Omega.*D;
temp = size(toplay);
no_frames = temp(2);
width = frameSize(1);
length = frameSize(2);
video_ori = zeros(width,length,no_frames); % width*length*frames
for i=1:no_frames
   video_ori(:,:,i) = reshape(toplay(:,i),width,length);
end
% implay(video_ori/256,100);

% background term video
toplay = output.L;
no_frames = size(toplay,2);
width = frameSize(1);
length = frameSize(2);
video_L = zeros(width,length,no_frames); % width*length*frames
for i=1:no_frames
   video_L(:,:,i) = reshape(toplay(:,i),width,length);
end

% sparse term video
toplay = output.S;
no_frames = size(toplay, 2);
width = frameSize(1);
length = frameSize(2);
video_S = zeros(width,length,no_frames); % width*length*frames
for i=1:no_frames
   video_S(:,:,i) = reshape(toplay(:,i),width,length);
end
figure();
video_combine = [video_ori, video_L, abs(video_S)];
for i=1:no_frames
    imagesc(video_combine(:,:,i));
    colormap('gray'); axis off;  title('FW-T');
    pause(0.01);
end

author: andrewssobral

repo: lrslibrary


text:
function quadrule_test01 ( )

%*****************************************************************************80
%
%% TEST01 tests CLENSHAW_CURTIS_RULE_COMPUTE and CLENSHAW_CURTIS_RULE_SET.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    05 March 2007
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'TEST01\n' );
  fprintf ( 1, '  CLENSHAW_CURTIS_RULE_COMPUTE computes\n' );
  fprintf ( 1, '  a Clenshaw-Curtis quadrature rule.\n' );
  fprintf ( 1, '  CLENSHAW_CURTIS_RULE_SET sets\n' );
  fprintf ( 1, '  a Clenshaw-Curtis quadrature rule.\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, '  Compare:\n' );
  fprintf ( 1, '    (X1,W1) from CLENSHAW_CURTIS_RULE_SET\n' );
  fprintf ( 1, '    (X2,W2) from CLENSHAW_CURTIS_RULE_COMPUTE\n' );
  fprintf ( 1, '\n' );
  fprintf ( 1, ...
    '     Order        W1            W2            X1            X2\n' );
  fprintf ( 1, '\n' );

  for order = 1 : 3 : 10

    [ x1, w1 ] = clenshaw_curtis_rule_set ( order );
    [ x2, w2 ] = clenshaw_curtis_rule_compute ( order );

    fprintf ( 1, '\n' );
    fprintf ( 1, '  %8d\n', order );

    for i = 1 : order
      fprintf ( 1, '            %12f  %12f  %12f  %12f\n', ...
        w1(i), w2(i), x1(i), x2(i) );
    end

  end

  return
end


text:
% Factor analysis
% Z -> X,  Z in R^k, X in R^D, k << D (high dimensional observations explained by small source)
% Z ~ N(0,I),   X|Z ~ N(L z, Psi), where Psi is diagonal.
%
% We compare to Zoubin Ghahramani's code.

state = 0;
rand('seed', state);
randn('seed', state);
max_iter = 3;
k = 2;
D = 4;
N = 10;
X = randn(N, D);

% Initialize as in Zoubin's ffa (fast factor analysis)
X=X-ones(N,1)*mean(X);
XX=X'*X/N;
diagXX=diag(XX);
cX=cov(X);
scale=det(cX)^(1/D);
randn('seed', 0);  % must reset seed here so initial params are identical to mfa
L0=randn(D,k)*sqrt(scale/k);
W0 = L0;
Psi0=diag(cX);

[L1, Psi1, LL1] = ffa(X,k,max_iter);

ns = [k D];
dag = zeros(2,2);
dag(1,2) = 1;
bnet = mk_bnet(dag, ns, 'discrete', [], 'observed', 2);
bnet.CPD{1} = gaussian_CPD(bnet, 1, 'mean', zeros(k,1), 'cov', eye(k), 'cov_type', 'diag', ...
			   'clamp_mean', 1, 'clamp_cov', 1);
bnet.CPD{2} = gaussian_CPD(bnet, 2, 'mean', zeros(D,1), 'cov', diag(Psi0), 'weights', W0, ...
			   'cov_type', 'diag', 'cov_prior_weight', 0, 'clamp_mean', 1);

engine = jtree_inf_engine(bnet);
evidence = cell(2,N);
evidence(2,:) = num2cell(X', 1);

[bnet2, LL2] = learn_params_em(engine, evidence, max_iter);

s = struct(bnet2.CPD{2});
L2 = s.weights;
Psi2 = s.cov;

% Compare to Zoubin's code
assert(approxeq(LL2, LL1));
assert(approxeq(Psi2, diag(Psi1)));
assert(approxeq(L2, L1));

author: bayesnet

repo: bnt

save_path: github-repos/MATLAB/bayesnet-bnt


text:
function H = histcImWin( I, edges, wtMask, shape )
% Calculates local histograms at every point in an image I.
%
% H(i,j,...,k,:) will contain the histogram at location (i,j,...,k), as
% calculated by weighing values in I by placing wtMask at that
% location.  For example, if wtMask is ones(windowSize) then the
% histogram at every location will simply be a histogram of the pixels
% within that window.  See histc2 for more information about histgorams.
% See convnFast for information on shape flags.
%
% USAGE
%  H = histcImWin( I, edges, wtMask, [shape] )
%
% INPUTS
%  I           - image (possibly multidimensional) [see above]
%  edges       - quantization bounds, see histc2
%  wtMask      - numeric array of weights, or cell array of sep kernels
%  shape       - ['full'], 'valid', 'same', or 'smooth'
%
% OUTPUTS
%  H           - [size(I)xnBins] array of size(I) histograms
%
% EXAMPLE
%  load trees; L=conv2(X,filterDog2d(10,4,1,0),'valid'); figure(1); im(L);
%  f1=filterGauss(25,[],25);  f2=ones(1,15);
%  H1 = histcImWin(L, 15, {f1,f1'}, 'same');  figure(2); montage2(H1);
%  H2 = histcImWin(L, 15, {f2,f2'}, 'same');  figure(3); montage2(H2);
%
% See also ASSIGNTOBINS, HISTC2, CONVNFAST, HISTCIMLOC
%
% Piotr's Image&Video Toolbox      Version 2.0
% Copyright 2012 Piotr Dollar.  [pdollar-at-caltech.edu]
% Please email me if you find bugs, or have suggestions or questions!
% Licensed under the Simplified BSD License [see external/bsd.txt]

if( nargin<4 || isempty(shape) ); shape = 'full';  end;
if( ~iscell(wtMask) ); wtMask={wtMask}; end;

% split I into channels
I = assignToBins( I, edges );
nBins=length(edges)-1; if(nBins==0); nBins=edges; end;
nd = ndims(I); siz=size(I);  maxI = max(I(:));
if( nd==2 && siz(2)==1); nd=1; siz=siz(1); end;
QI = false( [siz maxI] );
inds = {':'}; inds = inds(:,ones(1,nd));
for i=1:nBins;  QI(inds{:},i)=(I==i); end;
H = double( QI );

% convolve with wtMask to get histograms, scale appropriately
for i=1:length(wtMask)
  wtMaski = wtMask{i};
  for d=1:ndims(wtMaski); wtMaski = flipdim(wtMaski,d); end;
  wtMaski = wtMaski / sum(wtMaski(:));
  H = convnFast( H, wtMaski, shape );
end;

author: zouchuhang

repo: LayoutNet


text:
 function cells = blockify_data(ob, data, varargin)
%function cells = blockify_data(ob, data, varargin)

if isempty(ob.handle_blockify_data)
	fail('The %s of type %s has no handle_blockify_data', ...
		class(ob), ob.caller)
end
cells = ob.handle_blockify_data(ob, data, varargin{:});

author: JeffFessler

repo: mirt

save_path: github-repos/MATLAB/JeffFessler-mirt


text:
function cleanup(dirnameInstall, dirnameApp, options)
global platform

installfilename = sprintf('%s_install', lower(getAppname()));

if ~exist('dirnameInstall','var') || isempty(dirnameInstall)
    if exist('./Install','dir')
        dirnameInstall = filesepStandard([pwd, '/Install']);
    else
        dirnameInstall = filesepStandard(pwd);
    end
end
if ~exist('dirnameApp','var') || isempty(dirnameApp)
    dirnameApp = getAppDir();
end
if ~exist('options','var')
    options = 'end';
end

if exist([dirnameInstall, installfilename],'dir')
    rmdir_safe([dirnameInstall, installfilename]);
end
for ii = 1:length(platform.exename)
    if exist([dirnameInstall, platform.exename{ii}],'file')==2
        delete([dirnameInstall, platform.exename{ii}]);
    elseif exist([dirnameInstall, platform.exename{ii}],'dir')==7
        rmdir_safe([dirnameInstall, platform.exename{ii}]);
    end
end
if ispathvalid([dirnameApp, 'requiredMCRProducts.txt'])
    delete([dirnameApp, 'requiredMCRProducts.txt']);
end
if ispathvalid([dirnameInstall, 'requiredMCRProducts.txt'])
    delete([dirnameInstall, 'requiredMCRProducts.txt']);
end
if ispathvalid([dirnameInstall, 'desktopPath.txt'])
    delete([dirnameInstall, 'desktopPath.txt']);
end

for ii=1:length(platform.setup_exe)
    if exist([dirnameInstall, platform.setup_exe{ii}],'file')==2
        delete([dirnameInstall, platform.setup_exe{ii}]);
    elseif exist([dirnameInstall, platform.setup_exe{ii}],'dir')==7
        rmdir_safe([dirnameInstall, platform.setup_exe{ii}]);
    end
end
if optionExists(options,'start')
    if exist([dirnameInstall, 'Buildme.log'],'file')
        delete([dirnameInstall, 'Buildme.log']);
    end
    if exist([dirnameApp, 'Buildme_Setup.log'],'file')
        delete([dirnameApp, 'Buildme_Setup.log']);
    end
end
if exist([dirnameInstall, 'mccExcludedFiles.log'],'file')
    delete([dirnameInstall, 'mccExcludedFiles.log']);
end
if exist([dirnameApp, 'mccExcludedFiles.log'],'file')
    delete([dirnameApp, 'mccExcludedFiles.log']);
end

author: BUNPC