def __init__(self, primary_type, sub_type, parameters=None):
        if None in (primary_type, sub_type):
            raise ValueError("None not permitted in %r, %r" % (
                primary_type, sub_type))
        self.type = primary_type
        self.subtype = sub_type
        self.parameters = parameters or {}
Adapted from nibabel to quickly extract header info
dataset/ETHPy150Open byt3bl33d3r/pth-toolkit/lib/python2.7/site-packages/samba/external/testtools/content_type.py/ContentType.__init__--crossover with--dataset/ETHPy150Open mne-tools/mne-python/mne/source_space.py/_get_mgz_header