Exemplo n.º 1
0
 def __init__(self, spec_name, primary, association, type=None, format=None,   # @ReservedAssignment @IgnorePep8
              **kwargs):
     InputFilesets.__init__(self, spec_name, format,
                              frequency='per_session', **kwargs)
     self._primary = primary
     if association not in self.VALID_ASSOCIATIONS:
         raise BananaUsageError(
             "Invalid association '{}' passed to BidsAssocInput, "
             "can be one of '{}'".format(
                 association, "', '".join(self.VALID_ASSOCIATIONS)))
     self._association = association
     self._type = type
Exemplo n.º 2
0
 def __init__(self,
              spec_name,
              type,
              valid_formats=None,
              task=None,
              modality=None,
              **kwargs):
     InputFilesets.__init__(self,
                            spec_name,
                            pattern=None,
                            valid_formats=valid_formats,
                            frequency='per_session',
                            **kwargs)
     BaseBidsFileset.__init__(self, type, modality, task)
Exemplo n.º 3
0
 def initkwargs(self):
     dct = InputFilesets.initkwargs(self)
     dct['primary'] = self.primary
     dct['format'] = self.primary
     dct['association'] = self.association
     dct['type'] = self._type
     return dct
Exemplo n.º 4
0
    logger = logging.getLogger('banana')
    logger.setLevel(logging.DEBUG)
    # Stream Handler
    handler = logging.StreamHandler()
    formatter = logging.Formatter("%(levelname)s - %(message)s")
    handler.setFormatter(formatter)
    logger.addHandler(handler)
    # File Handler
    handler = logging.FileHandler(os.path.join(WORK_PATH, 'out.log'))
    formatter = logging.Formatter("%(levelname)s - %(message)s")
    handler.setFormatter(formatter)
    logger.addHandler(handler)

    inputs = [
        InputFilesets('series', dicom_format,
                      'R-L_MRtrix_60_directions_interleaved_B0_ep2d_diff_p2'),
        InputFilesets('magnitude', dicom_format,
                      'L-R_MRtrix_60_directions_interleaved_B0_ep2d_diff_p2')
    ]

    study = DwiStudy(
        name=args.study_name,
        repository=XnatRepo(project_id='MRH060',
                            server='https://mbi-xnat.erc.monash.edu.au',
                            cache_dir=os.path.join(scratch_dir,
                                                   'xnat_cache-mnd')),
        processor=SingleProc(
            work_dir=os.path.join(scratch_dir, 'xnat_working_dir-mnd')),
        inputs=inputs,
        subject_ids=args.subject,
        visit_ids=args.session,
Exemplo n.º 5
0
 def __hash__(self):
     return (InputFilesets.__hash__(self) ^
             hash(self.primary) ^
             hash(self.format) ^
             hash(self.association) ^
             hash(self._type))
Exemplo n.º 6
0
 def __eq__(self, other):
     return (InputFilesets.__eq__(self, other) and
             self.primary == other.primary and
             self.format == other.format and
             self.association == other.association and
             self._type == other._type)
Exemplo n.º 7
0
 def initkwargs(self):
     dct = InputFilesets.initkwargs(self)
     dct.update(BaseBidsFileset.initkwargs(self))
     return dct
Exemplo n.º 8
0
 def __hash__(self):
     return (InputFilesets.__hash__(self) ^
             BaseBidsFileset.__hash__(self))
Exemplo n.º 9
0
 def __eq__(self, other):
     return (InputFilesets.__eq__(self, other) and
             BaseBidsFileset.__eq__(self, other))
Exemplo n.º 10
0
 def __init__(self, spec_name, type, valid_formats=None, task=None,# @ReservedAssignment @IgnorePep8
              modality=None, **kwargs):
     InputFilesets.__init__(
         self, spec_name, pattern=None, valid_formats=valid_formats,
         frequency='per_session', **kwargs)  # @ReservedAssignment @IgnorePep8
     BaseBidsFileset.__init__(self, type, modality, task)