-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Victor Genty
committed
May 1, 2016
1 parent
a3ae8e9
commit d086df7
Showing
13 changed files
with
221 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
from .. import QtGui | ||
from .. import larcv | ||
from .. import np |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
from plotimage import PlotImage | ||
from .. import np | ||
|
||
class FakeColorImage(PlotImage): | ||
|
||
def __init__(self,img_v,roi_v,planes) : | ||
super(FakeColorImage,self).__init__(img_v,roi_v,planes) | ||
self.name = "FakeColorImage" | ||
|
||
def __create_mat__(self): | ||
|
||
#compressed images all have the same shape | ||
self.orig_mat = np.zeros(list(self.img_v[0].shape) + [3]) | ||
|
||
for ix,img in enumerate(self.img_v): | ||
|
||
if ix not in self.planes: | ||
continue | ||
|
||
self.orig_mat[:,:,ix] = img | ||
|
||
self.plot_mat = self.orig_mat.copy() | ||
|
||
self.plot_mat = self.plot_mat[:,:,(2,1,0)] | ||
|
||
def __threshold_mat__(self,imin,imax): | ||
|
||
#Have to profile this copy operation, could be bad | ||
self.plot_mat_t = self.plot_mat.copy() | ||
|
||
#I don't know how to slice | ||
self.plot_mat_t[ self.plot_mat_t < imin ] = 0 | ||
self.plot_mat_t[ self.plot_mat_t > imax ] = imax | ||
|
||
def __create_rois__(self): | ||
|
||
for ix,roi in enumerate(self.roi_v) : | ||
|
||
nbb = roi.BB().size() | ||
|
||
if nbb == 0: #there was no ROI continue... | ||
continue | ||
|
||
r = {} | ||
|
||
r['type'] = roi.Type() | ||
r['bbox'] = [] | ||
|
||
for iy in xrange(nbb): | ||
bb = roi.BB()[iy] | ||
r['bbox'].append(bb) | ||
|
||
self.rois.append(r) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from image_types.defaultimage import DefaultImage | ||
from image_types.fakecolorimage import FakeColorImage | ||
|
||
class ImageFactory(object): | ||
def __init__(self): | ||
self.name = "AhoFactory" | ||
|
||
def get(self,imdata,roidata,planes,improd): | ||
|
||
if improd == "fake_color": return FakeColorImage(imdata,roidata,planes) | ||
|
||
|
||
return DefaultImage(imdata,roidata,planes) |
Oops, something went wrong.