Skip to content

Commit

Permalink
add warnings for data check
Browse files Browse the repository at this point in the history
  • Loading branch information
DaisukeMiyamoto committed Jan 29, 2017
1 parent 1c76d03 commit a5d90ac
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 4 deletions.
Binary file modified docs/.doctrees/apis/swc2vtk.doctree
Binary file not shown.
Binary file modified docs/.doctrees/environment.pickle
Binary file not shown.
1 change: 1 addition & 0 deletions docs/apis/modules.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
<li class="toctree-l1"><a class="reference internal" href="../examples.html">Examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="../drawmode.html">Draw Mode</a></li>
<li class="toctree-l1"><a class="reference internal" href="../volume.html">Volume Rendering</a></li>
<li class="toctree-l1"><a class="reference internal" href="../annotations.html">Draw Annotations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../gallery.html">Gallery</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">swc2vtk</a><ul>
<li class="toctree-l2"><a class="reference internal" href="swc2vtk.html">swc2vtk package</a></li>
Expand Down
1 change: 1 addition & 0 deletions docs/apis/swc2vtk.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
<li class="toctree-l1"><a class="reference internal" href="../examples.html">Examples</a></li>
<li class="toctree-l1"><a class="reference internal" href="../drawmode.html">Draw Mode</a></li>
<li class="toctree-l1"><a class="reference internal" href="../volume.html">Volume Rendering</a></li>
<li class="toctree-l1"><a class="reference internal" href="../annotations.html">Draw Annotations</a></li>
<li class="toctree-l1"><a class="reference internal" href="../gallery.html">Gallery</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="modules.html">swc2vtk</a><ul class="current">
<li class="toctree-l2 current"><a class="current reference internal" href="#">swc2vtk package</a><ul>
Expand Down
1 change: 1 addition & 0 deletions docs/drawmode.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="volume.html">Volume Rendering</a></li>
<li class="toctree-l1"><a class="reference internal" href="annotations.html">Draw Annotations</a></li>
<li class="toctree-l1"><a class="reference internal" href="gallery.html">Gallery</a></li>
<li class="toctree-l1"><a class="reference internal" href="apis/modules.html">swc2vtk</a></li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions docs/volume.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
href="genindex.html"/>
<link rel="search" title="Search" href="search.html"/>
<link rel="top" title="swc2vtk 1.0.2 documentation" href="index.html"/>
<link rel="next" title="Gallery" href="gallery.html"/>
<link rel="next" title="Draw Annotations" href="annotations.html"/>
<link rel="prev" title="Draw Mode" href="drawmode.html"/>


Expand Down Expand Up @@ -93,6 +93,7 @@
<li class="toctree-l2"><a class="reference internal" href="#output-images">Output Images</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="annotations.html">Draw Annotations</a></li>
<li class="toctree-l1"><a class="reference internal" href="gallery.html">Gallery</a></li>
<li class="toctree-l1"><a class="reference internal" href="apis/modules.html">swc2vtk</a></li>
</ul>
Expand Down Expand Up @@ -172,7 +173,7 @@ <h2>Output Images<a class="headerlink" href="#output-images" title="Permalink to

<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">

<a href="gallery.html" class="btn btn-neutral float-right" title="Gallery" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="annotations.html" class="btn btn-neutral float-right" title="Draw Annotations" accesskey="n">Next <span class="fa fa-arrow-circle-right"></span></a>


<a href="drawmode.html" class="btn btn-neutral" title="Draw Mode" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous</a>
Expand Down
11 changes: 10 additions & 1 deletion swc2vtk/vtkgenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,24 @@ def _file2text(self, datafile_list, title):
text += 'SCALARS ' + title + ' float 1\n'
text += 'LOOKUP_TABLE default\n'

for filename in datafile_list:
if not (len(datafile_list) == len(self.swc_list)):
print('Warning: there is mismatch of data file and swc file (datafile=%d, swcfile=%d)'
% (len(datafile_list), len(self.swc_list)))
for datafile_list_index, filename in enumerate(datafile_list):
data_num = 0
with open(filename, 'r') as f:
read_data = f.readlines()

for i in range(len(read_data)):
if read_data[i][0] != '#':
data_num += 1
for j in range(self.ncell_per_compartment):
text += read_data[i].rstrip() + '\n'

if not (data_num == len(self.swc_list[datafile_list_index].data)):
print('Warning: there is mismatch of data file lines and swc file lines (index=%d, datafile=%d, swcfile=%d)'
% (datafile_list_index, data_num, len(self.swc_list[datafile_list_index].data)))

return text

def _radius2text(self):
Expand Down

0 comments on commit a5d90ac

Please sign in to comment.