@@ -315,7 +315,7 @@ def sex_openminds(data_subject: pd.DataFrame):
315315 return None
316316
317317
318- def create_subjects (subject_id , layout_df , layout , collection , dataset_name ):
318+ def create_subjects (subject_id , layout_df , layout , collection , dataset_short_name ):
319319
320320 sessions = layout .get_sessions ()
321321 subjects_dict = {}
@@ -333,7 +333,7 @@ def create_subjects(subject_id, layout_df, layout, collection, dataset_name):
333333 # dealing with condition that have no seasion
334334 if not sessions :
335335 state = omcore .SubjectState (
336- lookup_label = f"{ dataset_name } _{ subject_name } _state-01" .strip (),
336+ lookup_label = f"{ dataset_short_name } _{ subject_name } _state-01" .strip (),
337337 internal_identifier = f"{ subject_name } _state-01" .strip (
338338 )
339339 )
@@ -345,7 +345,7 @@ def create_subjects(subject_id, layout_df, layout, collection, dataset_name):
345345 for session in sessions :
346346 if not (table_filter (table_filter (layout_df , session , "session" ), subject , "subject" ).empty ):
347347 state = omcore .SubjectState (
348- lookup_label = f"{ dataset_name } _{ subject_name } _state-{ session } " .strip (),
348+ lookup_label = f"{ dataset_short_name } _{ subject_name } _state-{ session } " .strip (),
349349 internal_identifier = f"{ subject_name } _state-{ session } " .strip (
350350 )
351351 )
@@ -354,7 +354,7 @@ def create_subjects(subject_id, layout_df, layout, collection, dataset_name):
354354 state_cache .append (state )
355355 subject_state_dict [f"{ subject } " ] = state_cache_dict
356356 subject_cache = omcore .Subject (
357- lookup_label = f"{ dataset_name } _{ subject_name } " ,
357+ lookup_label = f"{ dataset_short_name } _{ subject_name } " ,
358358 internal_identifier = f"{ subject_name } " ,
359359 studied_states = state_cache
360360 )
@@ -381,7 +381,7 @@ def create_subjects(subject_id, layout_df, layout, collection, dataset_name):
381381 handedness = handedness_openminds (data_subject ),
382382 internal_identifier = f"{ subject_name } _state-01" .strip (
383383 ),
384- lookup_label = f"{ dataset_name } _{ subject_name } _state-01" .strip ()
384+ lookup_label = f"{ dataset_short_name } _{ subject_name } _state-01" .strip ()
385385 )
386386 collection .add (state )
387387 state_cache_dict ["" ] = state
@@ -393,15 +393,15 @@ def create_subjects(subject_id, layout_df, layout, collection, dataset_name):
393393 age = create_openminds_age (data_subject ),
394394 handedness = handedness_openminds (data_subject ),
395395 internal_identifier = f"{ subject_name } _state-{ session } " .strip (),
396- lookup_label = f"{ dataset_name } _{ subject_name } _state-{ session } " .strip ()
396+ lookup_label = f"{ dataset_short_name } _{ subject_name } _state-{ session } " .strip ()
397397 )
398398 collection .add (state )
399399 state_cache_dict [f"{ session } " ] = state
400400 state_cache .append (state )
401401 subject_state_dict [f"{ subject } " ] = state_cache_dict
402402 subject_cache = omcore .Subject (
403403 biological_sex = sex_openminds (data_subject ),
404- lookup_label = f"{ dataset_name } _{ subject_name } " ,
404+ lookup_label = f"{ dataset_short_name } _{ subject_name } " ,
405405 internal_identifier = f"{ subject_name } " ,
406406 # TODO species should default to homo sapiens
407407 species = spices_openminds (data_subject ),
0 commit comments