Skip to content

Commit 6914fc9

Browse files
authored
Merge pull request #349 from fefossa/rundeepprofiler
Add the option to have an image path inside index file
2 parents fabba56 + 8ed516f commit 6914fc9

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

deepprofiler/dataset/image_dataset.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy as np
22
import pandas as pd
3+
import os
34

45
import deepprofiler.dataset.pixels
56
import deepprofiler.dataset.utils
@@ -61,7 +62,9 @@ def __init__(self, metadata, sampling_field, channels, dataRoot, keyGen, config)
6162

6263
def get_image_paths(self, r):
6364
key = self.keyGen(r)
64-
image = [self.root + "/" + r[ch] for ch in self.channels]
65+
list_images = [r[ch] for ch in self.channels]
66+
paths = [(os.path.split(r[ch]))[0] for ch in self.channels]
67+
image = [list_images[ch] if os.path.isdir(paths[ch]) else self.root + "/" + list_images[ch] for ch in range(len(paths))]
6568
outlines = self.outlines
6669
if outlines is not None:
6770
outlines = self.outlines + r["Outlines"]

0 commit comments

Comments
 (0)