Nipy streamline conversions

Hello,

I am trying to convert a single white matter tract image in .trk format to .vtk with nipy/nibabel. I am new to python and having some trouble figuring out how to input the correct commands with correct formatting. nipy is installed and operating normally. I also found the example below from here, but can’t figure out how to substitute the example data with my data (sad, I know). I would love it if someone could provide me with a few annotations to the code below so I know where I am supposed to include my files (i.e., Arcuate_L.trk and FLAIR.nii as the reference volume). Hopefully, with a few tips to get me started I can figure out the rest.

import os
import nibabel as nib
import numpy as np
from dipy.io.stateful_tractogram import Space, StatefulTractogram
from dipy.io.streamline import load_tractogram, save_tractogram
from dipy.io.utils import (create_nifti_header, get_reference_info,
is_header_compatible)
from dipy.tracking.streamline import select_random_set_of_streamlines
from dipy.tracking.utils import density_map
from dipy.data.fetcher import (fetch_file_formats,
get_file_formats)

fetch_file_formats()
bundles_filename, ref_anat_filename = get_file_formats()
for filename in bundles_filename:
print(os.path.basename(filename))
reference_anatomy = nib.load(ref_anat_filename)

fetch_file_formats()
bundles_filename, ref_anat_filename = get_file_formats()
for filename in bundles_filename:
print(os.path.basename(filename))
reference_anatomy = nib.load(ref_anat_filename)

Thanks in advance for your help.

Travis