Closed firasm closed 9 years ago
here's the commit: a9586625987716c983adb14d0ee9f14c8b1b8a86
get all patients from an experiment:
def get_patients_from_experiment(Experiment_name, verbose = False,namesOnly=False):
subject_list = get_unique_list_elements(sarpy.Experiment(Experiment_name).get_SUBJECT_id())
Patients = []
for subject in subject_list:
curr_patient = sarpy.Patient(subject)
Patients.append(curr_patient)
if verbose:
print('Patient {0} has {1} sessions.'.format(subject,len(curr_patient.studies)))
if namesOnly:
return [a.patient_id for a in Patients]
else:
return list(set(Patients))
The new functionality within commit cb3d56f24 allows for quick access to all patients and all scanlabels in a given Experiment assembled from a masterlist. I would think a lot of the desired features aimed at above is covered by this. Obsolete?
agreed, this is all done except for "get all scan with given ‘adata’ (this is hard and potentially unrelated)"
and that one is a new feature request in #343.
I've created a helper function to help me parse masterlists and I want a second set of eyes on it to see if it's the right thing to do.
You can test it out as follows:
Here is the res printed
What do you think?
I need this because it's necessary to have a list/dictionary of scans for each scan_label provided. I intend to replace the code snippet in my wrappers that read the old masterlist: