Since we have been doing a lot of phantom experiments recently, the need has arisen for a way to get all scan labels from a particular study. We chose to keep the "patient" the same to keep all the phantom experiments together, and that makes sense.
I added this functionality by way of a function: sarpy.helpers.getLabelsByStudy()
def getLabelsByStudy(masterlist_name, studyAbbr = 'wL1'):
experimentList = sarpy.Experiment.from_masterlist('cest_FM.config')
newExpList = defaultdict(list)
for k,v in experimentList.labels.iteritems():
studyInK = False
for scan in v:
if studyAbbr in scan:
newExpList[k].append(scan)
return dict(newExpList)
Not sure if this is too specialized a case to include in the general functionality of masterlists - this will serve my purpose, even if there are no changes made.
Since we have been doing a lot of phantom experiments recently, the need has arisen for a way to get all scan labels from a particular study. We chose to keep the "patient" the same to keep all the phantom experiments together, and that makes sense.
I added this functionality by way of a function: sarpy.helpers.getLabelsByStudy()
this yields a nicely formatted dictionary:
sarpy.helpers.getLabelsByStudy('cest_FM.config','wL1')
Not sure if this is too specialized a case to include in the general functionality of masterlists - this will serve my purpose, even if there are no changes made.