Skip to content

Commit

Permalink
Remove length unit from BranchTimepointsFeature
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhahmann committed Jan 15, 2025
1 parent 6ee511d commit 1845b2a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,13 @@ public Spec()

final IntPropertyMap< BranchSpot > endTimepointsMap;

final String lengthUnits;

BranchTimepointsFeature( final IntPropertyMap< BranchSpot > startTimepointsMap, final IntPropertyMap< BranchSpot > endTimepointsMap,
final String lengthUnits )
BranchTimepointsFeature( final IntPropertyMap< BranchSpot > startTimepointsMap, final IntPropertyMap< BranchSpot > endTimepointsMap )
{
this.startTimepointsMap = startTimepointsMap;
this.endTimepointsMap = endTimepointsMap;
this.lengthUnits = lengthUnits;
this.projectionMap = new LinkedHashMap<>( 2 );
projectionMap.put( key( START_PROJECTION_SPEC ),
FeatureProjections.project( key( START_PROJECTION_SPEC ), startTimepointsMap, lengthUnits ) );
FeatureProjections.project( key( START_PROJECTION_SPEC ), startTimepointsMap, Dimension.NONE_UNITS ) );
projectionMap.put( key( END_PROJECTION_SPEC ),
FeatureProjections.project( key( END_PROJECTION_SPEC ), endTimepointsMap, Dimension.NONE_UNITS ) );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ public void createOutput()
if ( null == output )
output = new BranchTimepointsFeature(
new IntPropertyMap<>( branchGraph.vertices().getRefPool(), -1 ),
new IntPropertyMap<>( branchGraph.vertices().getRefPool(), -1 ),
model.getSpaceUnits() );
new IntPropertyMap<>( branchGraph.vertices().getRefPool(), -1 ) );
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,12 @@ public BranchTimepointsFeature deserialize(
final IntPropertyMap< Spot > endTimepointMap = new IntPropertyMap<>( graph.vertices(), -1 );
final IntPropertyMapSerializer< Spot > startTimepointSerializer = new IntPropertyMapSerializer<>( startTimepointMap );
final IntPropertyMapSerializer< Spot > endTimepointSerializer = new IntPropertyMapSerializer<>( endTimepointMap );
final String units = ois.readUTF();
startTimepointSerializer.readPropertyMap( idmap, ois );
endTimepointSerializer.readPropertyMap( idmap, ois );

// Map to branch-link -> val.
return new BranchTimepointsFeature( BranchFeatureSerializer.mapToBranchSpotMap( startTimepointMap, branchGraph ),
BranchFeatureSerializer.mapToBranchSpotMap( endTimepointMap, branchGraph ), units );
BranchFeatureSerializer.mapToBranchSpotMap( endTimepointMap, branchGraph ) );
}

@Override
Expand All @@ -90,7 +89,6 @@ public void serialize(
BranchFeatureSerializer.branchSpotMapToMap( feature.endTimepointsMap, branchGraph, graph );
final IntPropertyMapSerializer< Spot > startTimepointSerializer = new IntPropertyMapSerializer<>( startTimepointMap );
final IntPropertyMapSerializer< Spot > entTimepointsSerializer = new IntPropertyMapSerializer<>( endTimepointsMap );
oos.writeUTF( feature.lengthUnits );
startTimepointSerializer.writePropertyMap( idmap, oos );
entTimepointsSerializer.writePropertyMap( idmap, oos );
}
Expand Down

0 comments on commit 1845b2a

Please sign in to comment.