The hollow cavities of nanotubes could serve as templates for the growth of size- and shape-confined functional nanostructures, giving rise to novel materials and properties. In this work, considering their potential application as MRI contrast agents, gadolinium halides are encapsulated within the hollow cavities of inorganic nanotubes of WS2 by capillary filling to obtain GdX3@WS2 nanotubes (where X = Cl, Br or I and @ means encapsulated in). Aberration corrected scanning/transmission electron microscopy (S/TEM) and spectroscopy is employed to understand the morphology and composition of the GdI3@WS2 nanotubes. The three dimensional morphology is studied with STEM tomography but understanding the compositional information is a non-trivial matter due to the presence of multiple high atomic number elements. Therefore, energy dispersive X-ray spectroscopy (EDS) tomography was employed revealing the three dimensional chemical composition. Molecular dynamics simulations of the filling procedure shed light into the mechanics behind the formation of the confined gadolinium halide crystals. The quasi-1D system employed here serves as an example of a TEM-based chemical nanotomography method that could be extended to other materials, including beam-sensitive soft materials.