Skip to content

Commit

Permalink
MarsMicromanagerFormat: add hasPlane position method
Browse files Browse the repository at this point in the history
This changes translation so the local file locations are not used. Instead, planes are determined by what is in the metadata.txt file.
  • Loading branch information
karlduderstadt committed Nov 2, 2023
1 parent 2688b26 commit 5de9804
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,15 @@ public Location getLocation(final Metadata meta, final int imageIndex,
}

//DROP-IN
public boolean hasPlane(final Metadata meta, final int imageIndex,
final long planeIndex)
{
final long[] zct = FormatTools.rasterToPosition(imageIndex, planeIndex,
meta, Index.expectedAxes);

return planeToMetaTable.containsKey("MPlane-" + imageIndex + "-" + zct[0] + "-" + zct[1] + "-" + zct[2]);
}

public Map<String, String> getPlaneMap(final Metadata meta, final int imageIndex,
final long planeIndex)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,11 @@ private void populateMetadata(final Metadata meta,
store.setPlaneExposureTime(new Time(p.exposureTime, UNITS.SECOND), i,
q);

boolean fullPlane = true;
if (positions.get(i).tiffs != null) {
//Check if the tiff file exists. If a sparse collection was performed some planes
//may not have been collected. In that case, add empty placeholder plane data
final Location tiff = positions.get(i).getLocation(meta, i, q);
if (tiff != null && dataHandleService.exists(tiff)) fullPlane = true;
else fullPlane = false;
}
//If tiffs is null, there was no access to the original files when processing the metadata.txt
//In this case, full plane information is included for all possible planes.

ArrayList<MapPair> planeParameterList = new ArrayList<MapPair>();
if (fullPlane) {

//Check if the plane exists. If a sparse collection was performed some planes
//may not have been collected.
if (positions.get(i).hasPlane(meta, i, q)) {
if (nextStamp < p.timestamps.length)
store.setPlaneDeltaT(new Time(p.timestamps[nextStamp++],
UNITS.SECOND), i, q);
Expand Down

0 comments on commit 5de9804

Please sign in to comment.