-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support to load alignment pipeline parameters from URL-based reso…
…urces to facilitate usage in Google Cloud Spark runs
- Loading branch information
Showing
8 changed files
with
570 additions
and
6 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
render-app/src/main/java/org/janelia/alignment/util/UrlResourceUtil.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.janelia.alignment.util; | ||
|
||
import java.io.BufferedInputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.io.InputStreamReader; | ||
import java.io.Reader; | ||
import java.net.URL; | ||
import java.net.URLConnection; | ||
import java.util.zip.GZIPInputStream; | ||
import java.util.zip.ZipInputStream; | ||
|
||
/** | ||
* Shared URL management utilities. | ||
* | ||
* @author Eric Trautman | ||
*/ | ||
public class UrlResourceUtil { | ||
|
||
public static final UrlResourceUtil DEFAULT_INSTANCE = new UrlResourceUtil(); | ||
|
||
private final int bufferSize; | ||
|
||
public UrlResourceUtil() { | ||
this(DEFAULT_BUFFER_SIZE); | ||
} | ||
|
||
public UrlResourceUtil(final int bufferSize) { | ||
this.bufferSize = bufferSize; | ||
} | ||
|
||
public Reader getExtensionBasedReader(final URL url) | ||
throws IOException { | ||
|
||
final InputStream inputStream; | ||
|
||
final URLConnection connection = url.openConnection(); | ||
|
||
final String path = url.getPath(); | ||
if (path.endsWith(".gz")) { | ||
inputStream = new GZIPInputStream(connection.getInputStream()); | ||
} else if (path.endsWith(".zip")) { | ||
inputStream = new ZipInputStream(connection.getInputStream()); | ||
} else { | ||
inputStream = new BufferedInputStream(connection.getInputStream(), bufferSize); | ||
} | ||
|
||
return new InputStreamReader(inputStream); | ||
} | ||
|
||
private static final int DEFAULT_BUFFER_SIZE = 65536; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
156 changes: 156 additions & 0 deletions
156
...rc/main/resources/multisem/wafer_60/pipeline_json/01_match/pipe.01.match-patch-check.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
{ | ||
"multiProject": { | ||
"baseDataUrl" : "http://10.40.3.113:8080/render-ws/v1", | ||
"owner" : "trautmane", "project" : "w60_serial_290_to_299", | ||
"stackIdWithZ" : { "projectPattern": "^w6._serial_..._to_...$", "zValuesPerBatch": 1 } | ||
}, | ||
"pipelineStackGroups": { | ||
"raw": { "stackPattern": "^w.._s..._r.._d00$" }, | ||
"aligned": { "stackPattern": "^w.._s..._r.._d00_align$" }, | ||
"intensityCorrected": { "stackPattern": "^w.._s..._r.._d00_align_ic$" } | ||
}, | ||
"pipelineSteps": [ | ||
"DERIVE_TILE_MATCHES", | ||
"PATCH_MFOV_MONTAGE_MATCHES", | ||
"FIND_UNCONNECTED_MFOVS" | ||
], | ||
"matchRunList": [ | ||
{ | ||
"runName": "montageMfovRun", | ||
"matchCommon": { | ||
"maxPairsPerStackBatch" : 30, | ||
"featureStorage": { "maxFeatureSourceCacheGb": 6 }, | ||
"maxPeakCacheGb" : 2 | ||
}, | ||
"tilePairDerivationParameters": { | ||
"xyNeighborFactor": 0.6, "useRowColPositions": false, | ||
"zNeighborDistance": 0, "excludeCornerNeighbors": false, | ||
"excludeCompletelyObscuredTiles": false, "excludeSameLayerNeighbors": false, "excludeSameSectionNeighbors": false, | ||
"excludeSameMfovNeighbors": true, | ||
"excludePairsInMatchCollection": "pairsFromPriorRuns", "minExistingMatchCount": 0 | ||
}, | ||
"matchStageParametersList": [ | ||
{ | ||
"stageName": "montageMfovPass1", | ||
"featureExtraction": { "fdSize": 4, "maxScale": 1.0, "minScale": 0.25, "steps": 3 }, | ||
"featureMatchDerivation": { | ||
"matchFilter": "SINGLE_SET", "matchFullScaleCoverageRadius": 300.0, "matchIterations": 1000, "matchMaxEpsilonFullScale": 5.0, "matchMaxTrust": 4.0, | ||
"matchMinCoveragePercentage": 50.0, "matchMinInlierRatio": 0.0, "matchMinNumInliers": 25, "matchModelType": "TRANSLATION", "matchRod": 0.92 | ||
}, | ||
"featureRender": { "renderScale": 0.2, "renderWithFilter": true, "renderWithoutMask": false }, | ||
"featureRenderClip": { "clipHeight": 1300, "clipWidth": 1300 }, | ||
"geometricDescriptorAndMatch": { "gdEnabled": false } | ||
}, | ||
{ | ||
"stageName": "montageMfovPass2", | ||
"featureExtraction": { "fdSize": 4, "maxScale": 1.0, "minScale": 0.25, "steps": 3 }, | ||
"featureMatchDerivation": { | ||
"matchFilter": "SINGLE_SET", "matchFullScaleCoverageRadius": 300.0, "matchIterations": 1000, "matchMaxEpsilonFullScale": 5.0, "matchMaxTrust": 4.0, | ||
"matchMinCoveragePercentage": 20.0, "matchMinInlierRatio": 0.0, "matchMinNumInliers": 25, "matchModelType": "TRANSLATION", "matchRod": 0.92 | ||
}, | ||
"featureRender": { "renderScale": 0.3, "renderWithFilter": true, "renderWithoutMask": false }, | ||
"featureRenderClip": { "clipHeight": 1300, "clipWidth": 1300 }, | ||
"geometricDescriptorAndMatch": { "gdEnabled": false } | ||
}, | ||
{ | ||
"stageName": "montageMfovPass3", | ||
"featureExtraction": { "fdSize": 4, "maxScale": 1.0, "minScale": 0.25, "steps": 3 }, | ||
"featureMatchDerivation": { | ||
"matchFilter": "SINGLE_SET", "matchFullScaleCoverageRadius": 300.0, "matchIterations": 1000, "matchMaxEpsilonFullScale": 5.0, "matchMaxTrust": 4.0, | ||
"matchMinCoveragePercentage": 20.0, "matchMinInlierRatio": 0.0, "matchMinNumInliers": 25, "matchModelType": "TRANSLATION", "matchRod": 0.92 | ||
}, | ||
"featureRender": { "renderScale": 0.4, "renderWithFilter": true, "renderWithoutMask": false }, | ||
"featureRenderClip": { "clipHeight": 1300, "clipWidth": 1300 }, | ||
"geometricDescriptorAndMatch": { "gdEnabled": false } | ||
} | ||
] | ||
}, | ||
{ | ||
"runName": "montageRun", | ||
"matchCommon": { | ||
"maxPairsPerStackBatch" : 30, | ||
"featureStorage": { "maxFeatureSourceCacheGb": 6 }, | ||
"maxPeakCacheGb" : 2 | ||
}, | ||
"tilePairDerivationParameters": { | ||
"xyNeighborFactor": 0.6, "useRowColPositions": false, | ||
"zNeighborDistance": 0, "excludeCornerNeighbors": false, | ||
"excludeCompletelyObscuredTiles": false, "excludeSameLayerNeighbors": false, "excludeSameSectionNeighbors": false, | ||
"excludePairsInMatchCollection": "pairsFromPriorRuns", "minExistingMatchCount": 0 | ||
}, | ||
"matchStageParametersList": [ | ||
{ | ||
"stageName": "montagePass1", | ||
"featureExtraction": { "fdSize": 4, "maxScale": 1.0, "minScale": 0.25, "steps": 3 }, | ||
"featureMatchDerivation": { | ||
"matchFilter": "SINGLE_SET", "matchFullScaleCoverageRadius": 300.0, "matchIterations": 1000, "matchMaxEpsilonFullScale": 5.0, "matchMaxTrust": 4.0, | ||
"matchMinCoveragePercentage": 20.0, "matchMinInlierRatio": 0.0, "matchMinNumInliers": 25, "matchModelType": "TRANSLATION", "matchRod": 0.92 | ||
}, | ||
"featureRender": { "renderScale": 0.8, "renderWithFilter": true, "renderWithoutMask": false }, | ||
"featureRenderClip": { "clipHeight": 140, "clipWidth": 80 }, | ||
"geometricDescriptorAndMatch": { "gdEnabled": false } | ||
} | ||
] | ||
}, | ||
{ | ||
"runName": "crossRun", | ||
"matchCommon": { | ||
"maxPairsPerStackBatch" : 50, | ||
"featureStorage": { "maxFeatureSourceCacheGb": 6 }, | ||
"maxPeakCacheGb" : 2 | ||
}, | ||
"tilePairDerivationParameters": { | ||
"xyNeighborFactor" : 0.1, "useRowColPositions" : false, | ||
"zNeighborDistance" : 3, "excludeCornerNeighbors" : false, | ||
"excludeCompletelyObscuredTiles" : true, "excludeSameLayerNeighbors" : true, "excludeSameSectionNeighbors" : false, | ||
"excludePairsInMatchCollection": "pairsFromPriorRuns", "minExistingMatchCount": 0 | ||
}, | ||
"matchStageParametersList": [ | ||
{ | ||
"stageName": "crossPass1", | ||
"featureExtraction": { "fdSize": 4, "maxScale": 1.0, "minScale": 0.125, "steps": 5 }, | ||
"featureMatchDerivation": { | ||
"matchFilter": "SINGLE_SET", "matchFullScaleCoverageRadius": 150.0, "matchIterations": 1000, "matchMaxEpsilonFullScale": 5.0, "matchMaxTrust": 4.0, | ||
"matchMinCoveragePercentage": 50.0, "matchMinInlierRatio": 0.0, "matchMinNumInliers": 40, "matchModelType": "RIGID", "matchRod": 0.92 | ||
}, | ||
"featureRender": { "renderScale": 0.14, "renderWithFilter": true, "renderWithoutMask": false }, | ||
"geometricDescriptorAndMatch": { "gdEnabled": false }, | ||
"maxNeighborDistance": 3 | ||
}, | ||
{ | ||
"stageName": "crossPass2", | ||
"featureExtraction": { "fdSize": 4, "maxScale": 1.0, "minScale": 0.125, "steps": 5 }, | ||
"featureMatchDerivation": { | ||
"matchFilter": "SINGLE_SET", "matchFullScaleCoverageRadius": 150.0, "matchIterations": 1000, "matchMaxEpsilonFullScale": 5.0, "matchMaxTrust": 4.0, | ||
"matchMinCoveragePercentage": 50.0, "matchMinInlierRatio": 0.0, "matchMinNumInliers": 20, "matchModelType": "RIGID", "matchRod": 0.92 | ||
}, | ||
"featureRender": { "renderScale": 0.22, "renderWithFilter": true, "renderWithoutMask": false }, | ||
"geometricDescriptorAndMatch": { "gdEnabled": false }, | ||
"maxNeighborDistance": 3 | ||
}, | ||
{ | ||
"stageName": "crossPass3", | ||
"featureExtraction": { "fdSize": 4, "maxScale": 1.0, "minScale": 0.125, "steps": 5 }, | ||
"featureMatchDerivation": { | ||
"matchFilter": "AGGREGATED_CONSENSUS_SETS", "matchFullScaleCoverageRadius": 300.0, "matchIterations": 1000, "matchMaxEpsilonFullScale": 5.0, "matchMaxTrust": 4.0, | ||
"matchMinCoveragePercentage": 0.0, "matchMinInlierRatio": 0.0, "matchMinNumInliers": 10, "matchModelType": "RIGID", "matchRod": 0.92 | ||
}, | ||
"featureRender": { "renderScale": 0.4, "renderWithFilter": true, "renderWithoutMask": false }, | ||
"geometricDescriptorAndMatch": { "gdEnabled": false }, | ||
"maxNeighborDistance": 1 | ||
} | ||
] | ||
} | ||
], | ||
"mfovMontagePatch": { | ||
"sameLayerDerivedMatchWeight" : 0.15, | ||
"crossLayerDerivedMatchWeight" : 0.1, | ||
"secondPassDerivedMatchWeight" : 0.05, | ||
"xyNeighborFactor" : 0.6, | ||
"numberOfMFOVsPerBatch": 19 | ||
}, | ||
"unconnectedCrossMfov": { | ||
"minPairsForConnection": 6, | ||
"numberOfStacksPerBatch": 20 | ||
} | ||
} |
Oops, something went wrong.