classdef MatNatModality
    % MatNatModality Enumeration representing a modality for imaging data
    %
    %     Licence
    %     -------
    %     Part of MatNat. https://github.com/tomdoel/matnat
    %     Author: Tom Doel, 2015.  www.tomdoel.com
    %     Distributed under the GNU GPL v3 licence. Please see website for details.
    %        

    properties
        Name
        XnatType
    end
    
    methods
        function obj = MatNatModality(name, xnatType)
            obj.Name = name;
            obj.XnatType = xnatType;
        end
    end

    enumeration
        MR ('MR', 'xnat:mrScanData')
    end
    
    properties
    end
    
    methods (Static)
        function modality = getModalityFromXnatString(xnatType)
            % Get the modality type from the Xnat type string
            
            allEnums = enumeration('MatNatModality');
            for enum = allEnums
                if strcmp(xnatType, enum.XnatType)
                    modality = enum;
                    return;
                end
            end
            modality = [];
        end
    end
end


tomdoel
github-repos/MATLAB/tomdoel-pulmonarytoolkit/pulmonarytoolkit-09688a006d548fb85795df0338d1ed4f4a010fb9/External/matnat/MatNatModality.m
pulmonarytoolkit
github-repos/MATLAB/tomdoel-pulmonarytoolkit
09688a006d548fb85795df0338d1ed4f4a010fb9