<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Convert Tubes To PolyData
This notebook contains a few examples of how to call wrapped methods in itk and ITKTubeTK.
ITK and TubeTK must be installed on your system for this notebook to work.  Typically, this is accomplished by
python -m pip install itk-tubetk
Step1:  Load the tubes
Step2:  Generate the polydata representation of the tubes and save it to the file "Tube.vtp".
The Tube.vtp file can be displayed by dragging-and-dropping it onto ParaView Glance
<ASSISTANT_TASK:>
Python Code:
import os
import sys
import numpy
import itk
from itk import TubeTK as ttk
Explanation: Convert Tubes To PolyData
This notebook contains a few examples of how to call wrapped methods in itk and ITKTubeTK.
ITK and TubeTK must be installed on your system for this notebook to work.  Typically, this is accomplished by
python -m pip install itk-tubetk
End of explanation
PixelType = itk.F
Dimension = 3
ImageType = itk.Image[PixelType, Dimension]
    
# Read tre file
TubeFileReaderType = itk.SpatialObjectReader[Dimension]
    
tubeFileReader = TubeFileReaderType.New()
tubeFileReader.SetFileName("Data/MRI-Normals/Normal071-VascularNetwork.tre")
tubeFileReader.Update()
tubes = tubeFileReader.GetGroup()
Explanation: Load the tubes
End of explanation
ttk.WriteTubesAsPolyData.New(Input=tubes, FileName="Tube.vtp").Update()
Explanation: Generate the polydata representation of the tubes and save it to the file "Tube.vtp".
The Tube.vtp file can be displayed by dragging-and-dropping it onto ParaView Glance:
   https://kitware.github.io/paraview-glance/app/
End of explanation
<END_TASK>