Skip to content

Commit

Permalink
ImageXpress: support time dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
imagejan committed Apr 30, 2024
1 parent f419135 commit 83184eb
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/faim_ipa/hcs/imagexpress/ImageXpressWellAcquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def _assemble_tiles(self) -> list[Tile]:
tiles = []
for i, row in self._files.iterrows():
file = row["path"]
time_point = 0
time_point = row["t"] if row["t"] is not None else 0
channel = row["channel"]
metadata = load_metaseries_tiff_metadata(file)
if self._z_spacing is None:
Expand Down Expand Up @@ -77,12 +77,15 @@ def get_z_spacing(self) -> Optional[float]:
return self._z_spacing

def get_axes(self) -> list[str]:
axes = ["y", "x"]

if "z" in self._files.columns:
axes = ["z", "y", "x"]
else:
axes = ["y", "x"]
axes = ["z"] + axes

if self._files["channel"].nunique() > 1:
axes = ["c"] + axes

if "t" in self._files.columns and self._files["t"].nunique() > 1:
axes = ["t"] + axes

return axes
2 changes: 1 addition & 1 deletion src/faim_ipa/hcs/imagexpress/MixedAcquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _filter_mips(self, files: pd.DataFrame) -> pd.DataFrame:

def _get_root_re(self) -> re.Pattern:
return re.compile(
r".*[\/\\](?P<date>\d{4}-\d{2}-\d{2})[\/\\](?P<acq_id>\d+)(?:[\/\\]ZStep_(?P<z>\d+))?.*"
r".*[\/\\](?P<date>\d{4}-\d{2}-\d{2})[\/\\](?P<acq_id>\d+)(?:[\/\\]TimePoint_(?P<t>\d+))?(?:[\/\\]ZStep_(?P<z>\d+))?.*"
)

def _get_filename_re(self) -> re.Pattern:
Expand Down
4 changes: 3 additions & 1 deletion src/faim_ipa/hcs/imagexpress/SinglePlaneAcquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ def __init__(
)

def _get_root_re(self) -> re.Pattern:
return re.compile(r".*[\/\\](?P<date>\d{4}-\d{2}-\d{2})[\/\\](?P<acq_id>\d+)")
return re.compile(
r".*[\/\\](?P<date>\d{4}-\d{2}-\d{2})[\/\\](?P<acq_id>\d+)(?:[\/\\]TimePoint_(?P<t>\d+))?"
)

def _get_filename_re(self) -> re.Pattern:
return re.compile(
Expand Down
2 changes: 1 addition & 1 deletion src/faim_ipa/hcs/imagexpress/StackAcquisition.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _parse_files(self) -> pd.DataFrame:

def _get_root_re(self) -> re.Pattern:
return re.compile(
r".*[\/\\](?P<date>\d{4}-\d{2}-\d{2})[\/\\](?P<acq_id>\d+)(?:[\/\\]ZStep_(?P<z>\d+))"
r".*[\/\\](?P<date>\d{4}-\d{2}-\d{2})[\/\\](?P<acq_id>\d+)(?:[\/\\]TimePoint_(?P<t>\d+))?(?:[\/\\]ZStep_(?P<z>\d+))"
)

def _get_filename_re(self) -> re.Pattern:
Expand Down

0 comments on commit 83184eb

Please sign in to comment.