Skip to content

Commit 458ea7e

Browse files
authored
Merge pull request #41 from Peyman-N/repository_IRI
Adding IRI for file repository
2 parents deb2799 + fa59b62 commit 458ea7e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bids2openminds/main.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ def create_subjects(subject_id, layout_df, layout, collection):
296296

297297
def create_file(layout_df, BIDS_path, collection):
298298

299-
BIDS_directory_path = os.path.dirname(BIDS_path)
300-
file_repository = omcore.FileRepository()
299+
file_repository = omcore.FileRepository(
300+
iri=IRI(pathlib.Path(BIDS_path).absolute().as_uri()))
301301
collection.add(file_repository)
302302
files_list = []
303303
for index, file in layout_df.iterrows():
@@ -306,7 +306,7 @@ def create_file(layout_df, BIDS_path, collection):
306306
data_types = None
307307
extension = file["extension"]
308308
path = file["path"]
309-
iri = IRI(pathlib.Path(path).as_uri())
309+
iri = IRI(pathlib.Path(path).absolute().as_uri())
310310
name = os.path.basename(path)
311311
hashes = file_hash(path)
312312
storage_size = file_storage_size(path)

0 commit comments

Comments
 (0)