Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NIMS 1.1 #106

Merged
merged 5 commits into from
Jan 5, 2015
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
adapt sorter and processors for tgz datasets
- pfiles.tgz are unpacked for parsing, and sorting
- updates db models to include num_mux_cal_cycles to allow processor
to identify candidate muxepi aux files from db
  • Loading branch information
kevlarkevin committed Jan 5, 2015
commit efe5f3a0751505ad87d3c7f92fe34f0b13825b24
2 changes: 1 addition & 1 deletion nimsdata
8 changes: 5 additions & 3 deletions nimsgears/model/nims.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def __unicode__(self):

@classmethod
def from_mrfile(cls, mrfile):
subj_code, group_name, exp_name = nimsutil.parse_patient_id__(mrfile.subj_code, mrfile.group_name, mrfile.project_name, ResearchGroup.all_ids())
subj_code, group_name, exp_name = nimsutil.parse_patient_id(mrfile.patient_id, ResearchGroup.all_ids())
query = cls.query.join(Experiment, cls.experiment).filter(Experiment.name == exp_name)
query = query.join(ResearchGroup, Experiment.owner).filter(ResearchGroup.gid == group_name)
if subj_code:
Expand Down Expand Up @@ -605,7 +605,7 @@ def from_mrfile(cls, mrfile):
# central authority and/or querying the schedule database. But for now,
# just let the operator be None if the user isn't already in the system.
operator = User.by_uid(unicode(mrfile.operator), create=False)
session = Session(uid=uid, exam=mrfile.exam_no if isinstance(mrfile.exam_no, int) else 0, subject=subject, operator=operator)
session = Session(uid=uid, exam=int(mrfile.exam_no) if isinstance(mrfile.exam_no, (unicode, int)) else 0, subject=subject, operator=operator)
return session

@classmethod
Expand Down Expand Up @@ -696,6 +696,7 @@ class Epoch(DataContainer):
phase_encode_undersample = Field(Float)
slice_encode_undersample = Field(Float)
acquisition_matrix = Field(Unicode(255))
num_mux_cal_cycle = Field(Integer)

session = ManyToOne('Session')

Expand Down Expand Up @@ -727,7 +728,7 @@ def from_mrfile(cls, mrfile):
flip_angle = mrfile.flip_angle,
pixel_bandwidth = mrfile.pixel_bandwidth,
num_slices = mrfile.num_slices,
num_timepoints = mrfile.num_timepoints,
num_timepoints = mrfile.num_timepoints or 1,
num_averages = mrfile.num_averages,
num_echos = mrfile.num_echos,
receive_coil_name = unicode(mrfile.receive_coil_name),
Expand All @@ -744,6 +745,7 @@ def from_mrfile(cls, mrfile):
phase_encode_undersample = mrfile.phase_encode_undersample,
slice_encode_undersample = mrfile.slice_encode_undersample,
acquisition_matrix = unicode(str(mrfile.acquisition_matrix)),
num_mux_cal_cycle = mrfile.num_mux_cal_cycle if mrfile.filetype == u'pfile' else None, # hack for pfile
qa_status = u'pending',
# to unpack fov, mm_per_vox, and acquisition_matrix: np.fromstring(str(mm)[1:-1],sep=',')
)
Expand Down
Loading