@@ -1224,11 +1224,13 @@ def create_chunks_for_visualization(self, physio_file_id, data_dir):
12241224
12251225 chunk_root_dir_config = self .config_db_obj .get_config ("EEGChunksPath" )
12261226 chunk_root_dir = chunk_root_dir_config
1227- if not chunk_root_dir :
1228- # the bids_rel_dir is the first two directories in file_path (
1229- # bids_imports/BIDS_dataset_name_BIDSVersion)
1230- bids_rel_dir = file_path .split ('/' )[0 ] + '/' + file_path .split ('/' )[1 ]
1231- chunk_root_dir = data_dir + bids_rel_dir + '_chunks' + '/'
1227+ file_path_parts = file_path .split ('/' )
1228+ if chunk_root_dir_config :
1229+ chunk_root_dir = chunk_root_dir_config
1230+ else :
1231+ chunk_root_dir = data_dir + file_path_parts [0 ] + '/'
1232+
1233+ chunk_root_dir = chunk_root_dir + file_path_parts [1 ] + '_chunks' + '/'
12321234
12331235 # determine which script to run based on the file type
12341236 file_type = self .grep_file_type_from_file_id (physio_file_id )
@@ -1258,6 +1260,5 @@ def create_chunks_for_visualization(self, physio_file_id, data_dir):
12581260 self .insert_physio_parameter_file (
12591261 physiological_file_id = physio_file_id ,
12601262 parameter_name = 'electrophysiology_chunked_dataset_path' ,
1261- value = chunk_path .replace (chunk_root_dir_config , '' ) if chunk_root_dir_config
1262- else chunk_path .replace (data_dir , '' )
1263+ value = chunk_path .replace (data_dir , '' )
12631264 )
0 commit comments