Skip to content

Commit c6098a0

Browse files
committed
duplicate
1 parent 89c2b43 commit c6098a0

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

imagepy/menus/Image/Adjust/enhanceContrast_plg.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
from imagepy.core.engine import Filter
66
from skimage import exposure
77
import numpy as np
8+
89
class Plugin(Filter):
910
title = 'Enhance contrast'
1011
note = ['all', 'auto_msk', 'auto_snap','preview']
1112
para = {'percentage': 0.3}
1213
view = [(float, 'percentage', (0,100), 1, 'Saturated pixels', '%')]
1314

1415
def run(self, ips, snap, img, para = None):
15-
p2, p98 = np.percentile(snap, (0, 100 - para['percentage']))
16-
exposure.rescale_intensity(snap, in_range=(p2, p98))
16+
up, down = np.percentile(snap, (0, 100 - para['percentage']))
17+
exposure.rescale_intensity(snap, in_range=(up, down))

imagepy/menus/Image/duplicate_plg.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@ class Duplicate(Simple):
1414
title = 'Duplicate'
1515
note = ['all']
1616

17-
para = {'name':'Undefined','stack':True}
17+
# para = {'name':'Undefined','start':1,'end':2,'stack':True}
1818

1919
def load(self, ips):
20+
self.slength = len(ips.imgs)
21+
self.para = {'name':'Undefined','start':1,'end':self.slength,'stack':True}
2022
self.para['name'] = ips.title+'-copy'
2123
self.view = [(str, 'name', 'Name', '')]
2224
if ips.get_nslices()>1:
25+
self.view.append((int, 'start',
26+
(1,self.slength),0,'Start slice','1~%d'%self.slength))
27+
self.view.append((int, 'end',
28+
(1,self.slength),0,'End slice','1~%d'%self.slength))
2329
self.view.append((bool, 'stack', 'duplicate stack'))
2430
return True
2531
#process
@@ -42,6 +48,7 @@ def run(self, ips, imgs, para = None):
4248
ipsd.backimg = ips.backimg[sr, sc]
4349
'''
4450
elif ips.get_nslices()>1 and self.para['stack']:
51+
imgs=imgs[para['start']-1: para['end']]
4552
if ips.roi == None:
4653
if ips.is3d:imgs=imgs.copy()
4754
else:imgs = [i.copy() for i in imgs]

imagepy/menus/Plugins/temporal_plg.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,16 @@ def color_code(img, lut):
3131
class Plugin(Simple):
3232
title = 'Temporal color-code'
3333
note = ['all', 'stack']
34-
para = {'LUT':'Jet',
35-
'Start image':1,
36-
'End image': 2,
37-
'Creatbar':True}
38-
34+
# para = {'LUT':'Jet',
35+
# 'Start image':1,
36+
# 'End image': 2,
37+
# 'Creatbar':True}
3938
def load(self, ips):
4039
self.slength = len(ips.imgs)
40+
self.para = {'LUT':'Jet',
41+
'Start image':1,
42+
'End image': self.slength,
43+
'Creatbar':True}
4144
self.para['End image'] = self.slength
4245
self.view = [(list, 'LUT', list(ColorManager.luts.keys()), str, 'LUT',''),
4346
(int, 'Start image', (1,self.slength),0,'Start image','1~%d'%self.slength),

0 commit comments

Comments
 (0)