-------- Original Message --------
Subject: Re: NodeDoesNotExist2
Date: Tue, 9 Apr 2013 20:28:15 -0500
From: kurt weiss <
kurtrich...@gmail.com>
To: Rick Giuly <
rgi...@gmail.com>
I think you're right!! Its going past the last roadblock and the
dictionary seems to make more sense. I took out the print statements to
speed it up, but I think it will be tomorrow before we have a definitive
answer. Well done and thanks a lot! I'll start from scratch tomorrow and
see which of the fixes were absolutely essential and let you know for
the group.
Best,
Kurt
On Tue, Apr 9, 2013 at 7:47 PM, Rick Giuly <
rgi...@gmail.com
<mailto:
rgi...@gmail.com>> wrote:
I think I know what's wrong. The array indexing is probably going
out of bounds. You can print out "point" to figure it out for sure.
There's a line in data_viewer.py
borderWidthForFeatures = [18, 18, 0]
You need to make it
borderWidthForFeatures = [18, 18, 1]
I think it will then work with the new features.
This is a variable that tells it how much to stay away from the
borders in X, Y, and Z respectively so it doesn't go out of bounds.
Since we're now pulling features from above and below the point,
need to adjust the Z value.
kurt weiss wrote:
Yes, all works fine when I comment out the 'new' features. Printing
inputVolumeDict at the beginning of the function looks like
this: is
that right?
inputVolumeDict['__originalVolume']: [[[231 199 199 ..., 195
193 248]
[229 201 184 ..., 187 184 254]
[206 205 154 ..., 195 175 250]
...,
[ 81 63 197 ..., 109 97 45]
[ 97 56 162 ..., 109 123 64]
[ 0 0 0 ..., 0 0 0]]
[[243 225 228 ..., 199 178 219]
[248 227 221 ..., 182 163 226]
[232 223 169 ..., 189 159 222]
...,
[108 89 212 ..., 104 120 71]
[ 97 49 199 ..., 97 122 81]
[ 0 0 0 ..., 0 0 0]]
[[252 236 230 ..., 208 187 198]
[240 227 216 ..., 212 171 200]
[223 226 192 ..., 220 155 204]
...,
[ 87 98 205 ..., 85 130 88]
[ 89 68 198 ..., 75 126 88]
[ 0 0 0 ..., 0 0 0]]
...,
[[118 89 207 ..., 157 127 232]
[ 88 99 198 ..., 166 133 252]
[ 58 129 172 ..., 158 146 240]
...,
[106 158 173 ..., 143 154 85]
[101 136 148 ..., 181 122 101]
[ 0 0 0 ..., 0 0 0]]
[[178 44 148 ..., 138 108 206]
[153 61 170 ..., 159 116 232]
[103 84 178 ..., 164 136 242]
...,
[ 82 180 180 ..., 123 119 125]
[ 95 146 153 ..., 157 110 139]
[ 0 0 0 ..., 0 0 0]]
[[ 0 0 0 ..., 0 0 0]
[ 0 0 0 ..., 0 0 0]
[ 0 0 0 ..., 0 0 0]
...,
[ 0 0 0 ..., 0 0 0]
[ 0 0 0 ..., 0 0 0]
[ 0 0 0 ..., 0 0 0]]]
On Tue, Apr 9, 2013 at 3:21 PM, Rick Giuly <
rgi...@gmail.com
<mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>> wrote:
Does it work when you run it without any of the changes to the
function getPointFeaturesAt ? If yes, then the
inputVolumeDict['____originalVolume'] pretty much must be
there. Might
want to print inputVolumeDict['____originalVolume'] just to
make sure
it's as expected.
kurt weiss wrote:
Sorry. Same problem, values still null. I think I got all
instance of
volume re-assigned in that function (upated version
attached). I
am off
to class for a few hours so I won't be replying right
away.
Thanks for your time,
Kurt
in getPointFeatures line 1276: i= 0 & v= []
../data_viewer.py:416: UserWarning: deprecated: getVolume
warnings.warn("deprecated: getVolume")
in getPointFeatures line 1318 (afterFlatten): i= 0 &
v= []
values = []
/usr/local/lib/python2.7/dist-____packages/numpy-1.6.2-py2.7-____linux-x86_64.egg/numpy/core/____fromnumeric.py:2374:
RuntimeWarning: invalid value encountered in
double_scalars
return mean(axis, dtype, out)
lenth of values: 0
lenth of values: 0
lenth of values: 0
Traceback (most recent call last):
File "run_pipeline_test.py", line 366, in <module>
voxelStep('classifyVoxels')
File "run_pipeline_test.py", line 101, in voxelStep
voxelChunkSize)
File "../batch_process.py", line 74, in
batchProcessVoxels
runSteps(**segmentationParams)
File "../run_steps.py", line 152, in runSteps
detector.run(steps)
File "../segmentation_manager.py", line 115, in run
self.componentDetector.____runClassifyVoxels()
File "../component_detector.py", line 1856, in
runClassifyVoxels
numberOfLayersToProcess=self.____numberOfLayersToProcess)
File "../component_detector.py", line 817, in
classifyVoxels
self.voxelWeightDict)
File "../cytoseg_classify.py", line 531, in
recordLocalFeatures
'training', self, borderWidthForFeatures)
File "../cytoseg_classify.py", line 1331, in
getPointFeaturesAt
quantiles =
statistics.____sortAndReturnQuantiles(values)
File "../statistics.py", line 56, in
sortAndReturnQuantiles
return (values[0], values[N/4], values[N/2],
values[(3*N)/4],
values[N-1])
IndexError: index out of bounds
On Tue, Apr 9, 2013 at 1:00 PM, Rick Giuly
<
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>> wrote:
OK, I think 'volume' is null, totally empty, or
invalid. The
function uses inputVolumeDict now but I never got
rid of
the volume
parameter. (It's been a while since I coded this.)
So, looks like you need to try something like this:
originalVolume =
inputVolumeDict['______originalVolume'] and use
originalVolume in place of volume.
-rick
kurt weiss wrote:
Here you go, not too exciting of an output,
but thanks in
advance for
any tips. I put the following statements in
cytoseg_classify.py
right
after v and values are assigned:
(and note: at line 1273 there is a commented
out "for i in
range(3):" I
tried using this in place of range(1) and
nesting the
one loop
inside of
the 3, not clear what in range(1) would do?
isn't that
just once
execution while for i==0?)
in getPointFeatures line 1276: i= 0 & v= []
in getPointFeatures line 1318 (afterFlatten):
i= 0 &
v= []
values = []
and in the statistics..py I modified the moment
function to look
like this:
(to avoid initial crash)
def moment(values, c, exponent):
"""Returns moment about the value c"""
total = 0.0
print "lenth of values: ", len(values)
for value in values:
total += ((value-c)**exponent)
if len(values)!=0:
return total / len(values)
if len(values)==0:
return total
I will give you the whole output, but it only
ever
enters the
loop once
and I only ever see my print statements once,
right
before the
error:
runClassifyVoxels
self.numberOfLayersToProcess None
../data_viewer.py:446: UserWarning: deprecated
warnings.warn("deprecated")
../data_viewer.py:391: UserWarning:
deprecated: addVolume
warnings.warn("deprecated: addVolume")
recordLocalFeatures
learnLocalFeatures dimensions (350, 350, 75)
amount of blur: 0.5
amount of blur: 0.5
amount of blur: 0.5
amount of blur: 1.5
amount of blur: 1.5
amount of blur: 1.5
amount of blur: 2.5
amount of blur: 2.5
amount of blur: 2.5
in getPointFeatures line 1276: i= 0 & v= []
../data_viewer.py:416: UserWarning:
deprecated: getVolume
warnings.warn("deprecated: getVolume")
in getPointFeatures line 1318 (afterFlatten):
i= 0 &
v= []
values = []
/usr/local/lib/python2.7/dist-______packages/numpy-1.6.2-py2.__7-____linux-x86_64.egg/numpy/__core/____fromnumeric.py:2374:
RuntimeWarning: invalid value encountered in
double_scalars
return mean(axis, dtype, out)
lenth of values: 0
lenth of values: 0
lenth of values: 0
Traceback (most recent call last):
File "run_pipeline_test.py", line 366, in
<module>
voxelStep('classifyVoxels')
File "run_pipeline_test.py", line 101, in
voxelStep
voxelChunkSize)
File "../batch_process.py", line 74, in
batchProcessVoxels
runSteps(**segmentationParams)
File "../run_steps.py", line 152, in runSteps
detector.run(steps)
File "../segmentation_manager.py", line
115, in run
self.componentDetector.______runClassifyVoxels()
File "../component_detector.py", line
1856, in
runClassifyVoxels
numberOfLayersToProcess=self.______numberOfLayersToProcess)
File "../component_detector.py", line 817, in
classifyVoxels
self.voxelWeightDict)
File "../cytoseg_classify.py", line 531, in
recordLocalFeatures
'training', self, borderWidthForFeatures)
File "../cytoseg_classify.py", line 1329, in
getPointFeaturesAt
quantiles =
statistics.______sortAndReturnQuantiles(values)
File "../statistics.py", line 56, in
sortAndReturnQuantiles
return (values[0], values[N/4],
values[N/2],
values[(3*N)/4],
values[N-1])
IndexError: index out of bounds
On Tue, Apr 9, 2013 at 11:11 AM, Rick Giuly
<
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>>> wrote:
Hi Kurt, can you print out v and values
also to
help figure
this
out? (Just make sure you take the print
statements
back out
when
finished because this is executed for
every voxel, and
printing will
slow things down.)
kurt weiss wrote:
Thanks. That makes sense now. But it
seems that
everything is being
initialized properly then, and though
it does
seem to
make sense
that
len(values) cannot equal zero, it
does. Any
thoughts as
to why?
amount of blur: 2.5
amount of blur: 2.5
../data_viewer.py:416: UserWarning:
deprecated: getVolume
warnings.warn("deprecated:
getVolume")
i 0 values []
/usr/local/lib/python2.7/dist-________packages/numpy-1.6.2-__py2.__7-____linux-x86_64.egg/__numpy/__core/____fromnumeric.__py:2374:
RuntimeWarning: invalid value
encountered in
double_scalars
return mean(axis, dtype, out)
lenth of values: 0
lenth of values: 0
lenth of values: 0
Traceback (most recent call last):
File "run_pipeline_test.py", line
366, in
<module>
voxelStep('classifyVoxels')
File "run_pipeline_test.py", line
101, in
voxelStep
voxelChunkSize)
File "../batch_process.py", line
74, in
batchProcessVoxels
runSteps(**segmentationParams)
File "../run_steps.py", line 152,
in runSteps
detector.run(steps)
File
"../segmentation_manager.py", line
115, in run
self.componentDetector.________runClassifyVoxels()
File "../component_detector.py",
line 1856, in
runClassifyVoxels
numberOfLayersToProcess=self.________numberOfLayersToProcess)
File "../component_detector.py",
line 817, in
classifyVoxels
self.voxelWeightDict)
File "../cytoseg_classify.py",
line 531, in
recordLocalFeatures
'training', self, borderWidthForFeatures)
File "../cytoseg_classify.py",
line 1326, in
getPointFeaturesAt
quantiles =
statistics.________sortAndReturnQuantiles(values)
File "../statistics.py", line 56, in
sortAndReturnQuantiles
return (values[0], values[N/4],
values[N/2],
values[(3*N)/4],
values[N-1])
IndexError: index out of bounds
sleep@ubuntu1204:~/cytoseg-________read-only/s_cytoseg/__testing$
On Mon, Apr 8, 2013 at 6:07 PM, Rick
Giuly
<
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>>>> wrote:
Hi Kurt,
This line gives you v:
v =
volume[point[0]-size:point[0]+__________size,point[1]-size:____point[__1]+____size,point[2]-____size:__point[2]+____size]
It's just a small 3D volume
centered on
"point". It's
3x3x3. You can
make it a larger volume by
adjusting "i".
Regarding values:
values = v.flatten(1)
This means "get a list of of
every value
in the v
array" -
it's just
to get a list of numbers so you
can do
statistics
on them.
So it looks like you're
enabling the
statistics
related
stuff, and
for that to work, you'll need
the values. The
length of the
values
list should never be zero (it
should be
3x3x3 = 27
in this
case).
-rick
kurt weiss wrote:
Thanks Rick. This got me
past the
node not
existing,
but now I'm
stuck
on properly filling the
'values' array. I
think. Here
is what
happened:
after your fix I got the error:
Traceback (most recent call
last):
File
"run_pipeline_test.py", line
366, in
<module>
voxelStep('classifyVoxels')
File
"run_pipeline_test.py", line
101, in
voxelStep
voxelChunkSize)
File
"../batch_process.py", line
74, in
batchProcessVoxels
runSteps(**segmentationParams)
File "../run_steps.py",
line 152,
in runSteps
detector.run(steps)
File
"../segmentation_manager.py", line
115, in run
self.componentDetector.__________runClassifyVoxels()
File
"../component_detector.py",
line 1856, in
runClassifyVoxels
numberOfLayersToProcess=self.____________numberOfLayersToProcess)
File
"../component_detector.py",
line 817, in
classifyVoxels
self.voxelWeightDict)
File
"../cytoseg_classify.py",
line 531, in
recordLocalFeatures
'training', self, borderWidthForFeatures)
File
"../cytoseg_classify.py",
line 1320, in
getPointFeaturesAt
moments =
statistics.moments(values)
File "../statistics.py",
line 43,
in moments
numpy.sqrt(moment(values,
meanValue, 2)),
File "../statistics.py",
line 35,
in moment
return total /
len(values)
ZeroDivisionError: float
division by zero
So I made a quick if
statement to avoid
dividing by
zero and
subsequently got the
following error:
../data_viewer.py:416:
UserWarning:
deprecated: getVolume
warnings.warn("deprecated:
getVolume")
*i 0 values [] *
/usr/local/lib/python2.7/dist-__________packages/numpy-1.6.2-____py2.__7-____linux-x86_64.egg/____numpy/__core/______fromnumeric.__py:2374:
RuntimeWarning: invalid value
encountered in
double_scalars
return mean(axis, dtype,
out)
lenth of values: 0
lenth of values: 0
lenth of values: 0
Traceback (most recent call
last):
File
"run_pipeline_test.py", line
366, in
<module>
voxelStep('classifyVoxels')
File
"run_pipeline_test.py", line
101, in
voxelStep
voxelChunkSize)
File
"../batch_process.py", line
74, in
batchProcessVoxels
runSteps(**segmentationParams)
File "../run_steps.py",
line 152,
in runSteps
detector.run(steps)
File
"../segmentation_manager.py", line
115, in run
self.componentDetector.__________runClassifyVoxels()
File
"../component_detector.py",
line 1856, in
runClassifyVoxels
numberOfLayersToProcess=self.____________numberOfLayersToProcess)
File
"../component_detector.py",
line 817, in
classifyVoxels
self.voxelWeightDict)
File
"../cytoseg_classify.py",
line 531, in
recordLocalFeatures
'training', self, borderWidthForFeatures)
File
"../cytoseg_classify.py",
line 1326, in
getPointFeaturesAt
quantiles =
statistics.__________sortAndReturnQuantiles(values)
File "../statistics.py",
line 56, in
sortAndReturnQuantiles
return (values[0],
values[N/4],
values[N/2],
values[(3*N)/4],
values[N-1])
IndexError: index out of bounds
So it seems values is just
empty by
using the
print
statement.
The only
reference I see to it is at
line 1317 of
cytoseg_classify: How
should I
be filling values? and what
is it
exactly? and
what is v?
Thanks again,
Kurt
# experimental features
#if 0:
if i == 0:
f['grayValue'] =
at(volume, point)
#'differenceOfGaussian'
f['gradientMagnitude'] =
sqrt(pow(xG,2) +
pow(yG,2) +
pow(zG,2))
# experimental
features
#if 0:
stAtSelectedPoint =
structureTensor(xG,yG,zG)
sortedEigAtSelectedPoint =
numpy.linalg.eigvals(__________stAtSelectedPoint)
sortedEigAtSelectedPoint.sort(__________)
prefix =
sizeIdentifiers[i]
+ '_'
f[prefix + 'eig0'] =
sortedEigAtSelectedPoint[0]
f[prefix + 'eig1'] =
sortedEigAtSelectedPoint[1]
f[prefix + 'eig2'] =
sortedEigAtSelectedPoint[2]
values = v.flatten(1)
print "i", i,
"values", values
moments =
statistics.moments(values)
f[prefix + 'mean']
= moments[0]
f[prefix +
'standardDeviation'] =
moments[1]
f[prefix +
'thirdMoment'] =
moments[2]
f[prefix +
'fourthMoment']
= moments[3]
quantiles =
statistics.__________sortAndReturnQuantiles(values)
f[prefix +
'minimum'] =
quantiles[0]
f[prefix +
'0.25-quantile'] =
quantiles[1]
f[prefix +
'median'] =
quantiles[2]
f[prefix +
'0.75-quantile'] =
quantiles[3]
f[prefix +
'maximum'] =
quantiles[4]
On Mon, Apr 8, 2013 at 3:57
PM, Rick
Giuly
<
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>
<mailto:
rgi...@gmail.com <mailto:
rgi...@gmail.com>>>>>>> wrote:
Hi Kurt,
Actually, I think this
may be the
problem, in the
function
recordLocalFeatures.
Try just
changing
the "if 0"
to "if
1". I may
have just removed that
derivative
calculation and
now it
needs to be
put back.
Code snippet:
file =
open(voxelExamplesFilename, "w")
filteredVolume =
self.getPersistentObject(______________voxelTrainingImageNodePath)
sh =
filteredVolume.shape
#originalVolume =
self.getPersistentObject(____________originalVolumeNodePath)
print
"learnLocalFeatures
dimensions", sh
if 0:
self.calculateDerivatives(____________filteredVolume,
'training')
volume =
numpy.zeros(sh)
#selected x,
y, and z
# get point
features at the
arbitrary point
borderWidthFeatures
# to get a
list of
feature names
dictionary =
getPointFeaturesAt(____________inputVolumeDict,
filteredVolume,
'training', self, borderWidthForFeatures)
kurt weiss wrote:
Hi Rick,
I tried to comment
in the
eigenvalues and
structure
tensor in
cytoseg_classify.py, but I'm
getting
a Node
DoesNotExist error
at this
line:
xGVolume =
gui.getVolume('%s_0Gradient_____________blur%d' %\
(derivativeVolumesIdentifier, i))
I attempted a few
changes
like calling
gui.getVolume_new instead
of the
deprecated
function and
commenting in
the i=0
statement
above
xGVolume=..., and well
messing around
with a whole
bunch of stuff in
hopes of figuring
it out
myself, but
no luck. Any
suggestions?
Here is a snippet
of the error
followed by a
snippet of
the code I
changed. The full
terminal
output and
cytoseg_classify.py files are
attached.
Thank You very much,
Kurt
ERROR:
from 0 to 4,
loading image
index 4,
stack has
72 images
data/example/in/cropped
input004.tif
volume.shape (615,
551, 5)
subvolume
box.cornerA [0, 0, 0]
subvolume
box.cornerB [615,
551, 5]
subvolume
box.shape() [615
551 5]
volume shape (615,
551)
full array shape
(615, 551)
cropped array shape
(615, 551)
../data_viewer.py:493:
UserWarning:
deprecated
warnings.warn("deprecated")
runClassifyVoxels
self.numberOfLayersToProcess
None
../data_viewer.py:446:
UserWarning:
deprecated
warnings.warn("deprecated")
../data_viewer.py:391:
UserWarning:
deprecated: addVolume
warnings.warn("deprecated:
addVolume")
recordLocalFeatures
learnLocalFeatures
dimensions (350,
350, 75)
../data_viewer.py:416:
UserWarning:
deprecated: getVolume
warnings.warn("deprecated:
getVolume")
Traceback (most
recent call
last):
File
"run_pipeline_test.py", line
366, in
<module>
voxelStep('classifyVoxels')
File
"run_pipeline_test.py", line
101, in
voxelStep
voxelChunkSize)
File
"../batch_process.py", line
74, in
batchProcessVoxels
runSteps(**segmentationParams)
File
"../run_steps.py",
line 152,
in runSteps
detector.run(steps)
File
"../segmentation_manager.py", line
115, in run
self.componentDetector.____________runClassifyVoxels()
File
"../component_detector.py",
line 1856, in
runClassifyVoxels
numberOfLayersToProcess=self.________________numberOfLayersToProcess)
File
"../component_detector.py",
line 817, in
classifyVoxels
self.voxelWeightDict)
File
"../cytoseg_classify.py",
line 531, in
recordLocalFeatures
'training', self, borderWidthForFeatures)
File
"../cytoseg_classify.py",
line 1285, in
getPointFeaturesAt
(derivativeVolumesIdentifier, i))
File
"../data_viewer.py", line
417, in
getVolume
node =
getNode(self.mainDoc.____________dataRootNode,
('Volumes', name))
File
"../tree.py", line
295, in
getNode
currentNode =
currentNode.getChild(name)
File
"../tree.py", line
140, in
getChild
raise
NodeDoesNotExist, ("Tried to
access node
named %s but it
wasn't there.
(parent node
name: %s)
(parent
node: %s)"
% (name,
self.name <
http://self.name> <
http://self.name>
<
http://self.name> <
http://self.name>
<
http://self.name> <
http://self.name>
<
http://self.name>, self))
tree.NodeDoesNotExist: Tried to
access node named
training_0Gradient_blur0 but it
wasn't there.
(parent
node name:
Volumes) (parent node:
Volumes( test
volume
1() test
volume 2()
voxelTrainingImage()
voxelTrainingLabel()
default_testOriginalVolume()
inputImage()))
******************************____________********************__**__**__**__**__**__**********__****__****__**
cytoseg_classify.py
lines
1258 - 1331
def
getPointFeaturesAt(____________inputVolumeDict,
volume,
derivativeVolumesIdentifier,
gui, point):
"""Get features (for classification) at a particular point"""
# f is
dictionary of
features
if
not(isInsideVolumeWithBorder(____________volume,
point,
borderWidthForFeatures)):
raise
Exception,
'The point
%s is
not inside the
volume enough.
In needs to be away
from the
border by %d
pixels for x, %d
pixels for y,
and %d pixels for
z. Volume
shape:
%s' % (point,
borderWidthForFeatures[0],
borderWidthForFeatures[1],
borderWidthForFeatures[2],
str(volume.shape))
f = odict()
#sizeIdentifiers =
('3x3x3',
'5x5x5',
'7x7x7')
sizeIdentifiers = ('(3)',
'(5)', '(7)')
v = [None,
None, None]
#for i in
range(3):
for i in
range(1):
size = i+1
v =
volume[point[0]-size:point[0]+____________size,point[1]-size:______point[__1]+____size,point[__2]-____size:__point[2]+______size]
#
experimental
features
#if 0:
#i = 0
#todo: note that
getVolume may
be a slow
operation
xGVolume =
gui.getVolume('%s_0Gradient_____________blur%d' %\
(derivativeVolumesIdentifier, i))
xG =
at(xGVolume,
point)
yGVolume =
gui.getVolume('%s_1Gradient_____________blur%d' %\
(derivativeVolumesIdentifier, i))
yG =
at(yGVolume,
point)
zGVolume =
gui.getVolume('%s_2Gradient_____________blur%d' %\
(derivativeVolumesIdentifier, i))
zG =
at(zGVolume,
point)
#
experimental
features
#if 0:
if i == 0:
f['grayValue'] =
at(volume, point)
#'differenceOfGaussian'
f['gradientMagnitude'] =
sqrt(pow(xG,2) +
pow(yG,2) +
pow(zG,2))
#
experimental
features
#if 0:
stAtSelectedPoint =
structureTensor(xG,yG,zG)
sortedEigAtSelectedPoint =
numpy.linalg.eigvals(____________stAtSelectedPoint)
sortedEigAtSelectedPoint.sort(____________)
prefix =
sizeIdentifiers[i]
+ '_'
f[prefix
+ 'eig0'] =
sortedEigAtSelectedPoint[0]
f[prefix
+ 'eig1'] =
sortedEigAtSelectedPoint[1]
f[prefix
+ 'eig2'] =
sortedEigAtSelectedPoint[2]
values =
v.flatten(1)
#print "i", i,
"values", values
moments =
statistics.moments(values)
f[prefix
+ 'mean']
= moments[0]
f[prefix +
'standardDeviation'] =
moments[1]
f[prefix +
'thirdMoment'] =
moments[2]
f[prefix +
'fourthMoment']
= moments[3]
quantiles =
statistics.____________sortAndReturnQuantiles(values)
f[prefix +
'minimum'] =
quantiles[0]
f[prefix +
'0.25-quantile'] =
quantiles[1]
f[prefix
+ 'median'] =
quantiles[2]
f[prefix +
'0.75-quantile'] =
quantiles[3]
f[prefix +
'maximum'] =
quantiles[4]
--
.
--
.
--
.