forked from nilesh-patil/python-XTensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathXTensions_template.py
More file actions
61 lines (46 loc) · 1.65 KB
/
XTensions_template.py
File metadata and controls
61 lines (46 loc) · 1.65 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
58
59
60
61
# Imaris Extension
#
# Copyright (C) 2018 Nilesh patil <nilesh.patil@rochester.edu>, MIT license
#
# <CustomTools>
# <Menu name = "Python plugins">
# <Submenu name = "Submenu">
# <Item name="Name of XTension" icon="Python" tooltip="Description to be shown in tooltip">
# <Command>PythonXT::XTensions_template(%i)</Command>
# </Item>
# </Submenu>
# </Menu>
# </CustomTools>
import os
import time
import ImarisLib
from tqdm import tqdm
import numpy as np
import pandas as pd
from cvbi.gui import *
# Template Extension description for function
def XTensions_template(aImarisId):
vImarisLib = ImarisLib.ImarisLib()
vImaris = vImarisLib.GetApplication(aImarisId)
vDataSet = vImaris.GetDataSet()
imaris_file = vImaris.GetCurrentFileName()
imaris_dir = os.path.dirname(imaris_file)
imaris_name = os.path.basename(imaris_file)
input_dir = get_dir(window_title = 'Select Input Folder :', initial_dir = imaris_dir, w = 400, h = 300)
output_dir = get_dir(window_title = 'Select Output Folder :', initial_dir = imaris_dir, w = 400, h = 300)
print('''
#####################################################
########### Extension started ###############
#####################################################
''')
time.sleep(5)
# Put your code here
for i in tqdm(range(1000000)):
pass
print('''
#####################################################
###### Extension finished ######
###### Wait for 5s to close automatically ######
#####################################################
''')
time.sleep(5)