vmtkmeshmergetimesteps UnboundLocalError


I try to trace particles using the tutorial Particle Tracing | vmtk - the Vascular Modelling Toolkit . Following the steps one by one, when i tried to execute vmtkmeshmergetimesteps like:

vmtkmeshmergetimesteps -directory ~C:/Users/Desktop/thesis/thesis1/kalokalo/Simulations/kalokalo/5/kalokalo-converted-results
-firststep 0 -laststep 2800 -intervalstep 10 -velocityvector 1 -vector velocity
-pattern all_results_%5s.vtu -ofile total_results.vtu

i get the error message :

Traceback (most recent call last):
File “C:\Users\DELL\anaconda3\envs\foo\lib\site-packages\vmtk\pypeserver.py”, line 46, in RunPypeProcess
File “C:\Users\DELL\anaconda3\envs\foo\lib\site-packages\vmtk\pype.py”, line 324, in Execute
File “C:\Users\DELL\anaconda3\envs\foo\lib\site-packages\vmtk\vmtkmeshmergetimesteps.py”, line 116, in Execute
if (self.Pattern%step).replace(’ ',‘0’) in fileList:
UnboundLocalError: local variable ‘fileList’ referenced before assignment

The pattern of the files is all_results_01234.vtu.
Any help regarding the UnboundLocalError would be much appreciated!

Kind Regards,

It looks like InputDirectoryName was not set correctly, for example you have set invalid path or there were no files in the directory.

It would be nice if you update the script to show a more detailed error message (e.g., input folder does not exist; no files were found in folder…) and send a pull request.