Skip to content

Commit

Permalink
Handling membrane images in Mesmer (labsyspharm#509)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArtemSokolov authored Jun 16, 2023
1 parent 66470b3 commit 3e5d78a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 2023-06-16

* If `--membrane-channel` is provided to Mesmer options, MCMICRO will automatically pass the input image both as `--nuclear-image` and as `--membrane-image` to the Mesmer CLI.

### 2023-03-10

* [viz] Auto-Minerva story construction will now read channel names from `markers.csv`
Expand Down
1 change: 1 addition & 0 deletions config/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ modules:
version: 0.4.0
cmd: python /usr/src/app/run_app.py mesmer --squeeze --output-directory . --output-name cell.tif
input: --nuclear-image
membrane-input: --membrane-image
channel: --nuclear-channel
idxbase: 0
watershed: 'no'
Expand Down
12 changes: 10 additions & 2 deletions lib/worker.nf
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,18 @@ process worker {
// if they all use the same model file.
script:

// Find module specific parameters and compose a command
def cmd = "${module.cmd} ${module.input} $inp ${Opts.moduleOpts(module, mcp)}"
// Find module specific parameters
def opts = "${Opts.moduleOpts(module, mcp)}"

// Determine if we need to pass the input as a membrane image also
def mmbr = (opts.indexOf('membrane') > -1 && module.containsKey('membrane-input')) ?
"${module['membrane-input']} $inp" : ""

// Compose the command
def cmd = "${module.cmd} ${module.input} $inp $mmbr $opts"
String m = "${module.name}-model"

// Create a copy of the model file if one is provided
if( mcp.workflow.containsKey(m) ) {
def mdlcp = "cp-${model.name}"
"""
Expand Down

0 comments on commit 3e5d78a

Please sign in to comment.