forked from DiamondKMG/ml_fish_seg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
seg.nf
44 lines (33 loc) · 1.13 KB
/
seg.nf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env nextflow
params.fish_dir = "$baseDir/fish_segmentations"
modelfn = '$baseDir/models/augmented_unet.h5'
imagesCh = Channel
.fromPath("${params.fish_dir}/*jpg",type:'file')
.map { file -> tuple(file.baseName, file) }
segCh = Channel
.fromPath("${params.fish_dir}/*nii.gz",type:'file')
.map { file -> tuple(file.baseName, file) }
process resizeImgs {
tag "$filebasename"
input:
set filebasename, file(img) from imagesCh
file resizeScript from file("resize.R")
output:
set filebasename, file("${filebasename}.nii") into re_img_channel
script:
"""
Rscript $resizeScript --file $img --size 256 --output ${filebasename}.nii --interp linear
"""
}
process resizeSegs {
tag "$filebasename"
input:
set filebasename, file(img) from segCh
file resizeScript from file("resize.R")
output:
set filebasename, file("${filebasename}") into re_seg_channel
script:
"""
Rscript $resizeScript --file $img --size 256 --output ${filebasename} --interp nearestNeighbor
"""
}