Skip to content

Commit

Permalink
Create (and use) a method to add a filter spec to a tile spec
Browse files Browse the repository at this point in the history
  • Loading branch information
minnerbe committed Dec 6, 2024
1 parent e7903c0 commit a405ea4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions render-app/src/main/java/org/janelia/alignment/spec/TileSpec.java
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,10 @@ public FilterSpec getFilterSpec() {
return spec;
}

/**
* Set a filter spec for this tile spec (replacing any existing filter spec).
* @param filterSpec the filter spec to set for this tile spec
*/
public void setFilterSpec(final FilterSpec filterSpec) {
this.filterSpec = filterSpec;
if (channels != null) {
Expand All @@ -669,6 +673,15 @@ public void setFilterSpec(final FilterSpec filterSpec) {
}
}

/**
* Add a filter spec to this tile spec (combining with any existing filter spec).
* @param filterSpec the filter spec to add
*/
public void addFilterSpec(final FilterSpec filterSpec) {
final FilterSpec combinedFilterSpec = FilterSpec.combine(this.filterSpec, filterSpec);
setFilterSpec(combinedFilterSpec);
}

public boolean hasTransforms() {
return ((transforms != null) && (transforms.size() > 0));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ private void addShadingCorrectionToTileSpec(

// convert to filter and add to tile spec
final ShadingCorrectionFilter filter = new ShadingCorrectionFilter(tileModel);
tileSpec.setFilterSpec(FilterSpec.forFilter(filter));
tileSpec.addFilterSpec(FilterSpec.forFilter(filter));
}

final List<double[]> uniformGrid(final int n) {
Expand Down

0 comments on commit a405ea4

Please sign in to comment.