-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathset_stack_resolution.py
More file actions
57 lines (48 loc) · 2.16 KB
/
Copy pathset_stack_resolution.py
File metadata and controls
57 lines (48 loc) · 2.16 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
import renderapi
from ..module.render_module import RenderModule, RenderParameters
from argschema.fields import Str, Int, List
example_json = {
"render": {
"host": "ibs-forrestc-ux1",
"port": 8080,
"owner": "Forrest",
"project": "M247514_Rorb_1",
"client_scripts" : "/pipeline/render/render-ws-java-client/src/main/scripts"
},
"stacks": ["BIGALIGN_LENS_DAPI_1_deconvnew"],
"stackResolutionX": 3,
"stackResolutionY": 3,
"stackResolutionZ": 50
}
class SetStackResolutionParameters(RenderParameters):
stacks = List(Str,required=True,
description= 'stack to change resolution of')
stackResolutionX = Int(required=False,
description= 'X stack resolution (nm)')
stackResolutionY = Int(required=False,
description= 'Y stack resolution (nm)')
stackResolutionZ = Int(required=False,
description= 'Z stack resolution (nm)')
class SetStackResolution(RenderModule):
def __init__(self, schema_type=None, *args, **kwargs):
if schema_type is None:
schema_type = SetStackResolutionParameters
super(SetStackResolution, self).__init__(
schema_type=schema_type, *args, **kwargs)
def run(self):
for stack in self.args['stacks']:
stackMetadata = renderapi.stack.get_stack_metadata(
stack, render=self.render)
stackMetadata.stackResolutionX = self.args.get(
'stackResolutionX', stackMetadata.stackResolutionX)
stackMetadata.stackResolutionY = self.args.get(
'stackResolutionY', stackMetadata.stackResolutionY)
stackMetadata.stackResolutionZ = self.args.get(
'stackResolutionZ', stackMetadata.stackResolutionZ)
stackMetadata = renderapi.stack.set_stack_metadata(
stack, stackMetadata, render=self.render)
renderapi.stack.set_stack_state(stack, 'COMPLETE',
render=self.render)
if __name__ == "__main__":
mod = SetStackResolution(input_data=example_json)
mod.run()