Skip to content

gap appears when I generate the nii.gz file from .tre when using TubeTK #141

@jinshuozhang

Description

@jinshuozhang

Thank you for sharing your excellent project professor!

I meet the same problems as [Subhashis-Banerjee] https://github.com/InsightSoftwareConsortium/ITKTubeTK/issues/81 when I try to generate the label image from .tre

my .mha and .tre data come from the public dataset https://public.kitware.com/Wiki/TubeTK/Data, the size of the image is 448×448×128 and the spacing is 0.513×0.513×0.8.

I use the 'Normal002-MRA.mha' and the corresponding VascularNetwork.tre for testing. the following is my code:

`
import itk
from itk import TubeTK as ttk

PixelType = itk.F
Dimension = 3
ImageType = itk.Image[PixelType, Dimension]

Read tre file

TubeFileReaderType = itk.SpatialObjectReader[Dimension]

tubeFileReader = TubeFileReaderType.New()
tubeFileReader.SetFileName("F:/MIDAS_data/002/Vessel_annotation_file/VascularNetwork.tre")
tubeFileReader.Update()
tubes = tubeFileReader.GetGroup()

''''###
SurfWriter = ttk.WriteTubesAsPolyData.New()
SurfWriter.SetFileName("F:/MIDAS_data/002/vesselsurface.vtp")
SurfWriter.SetInput(tubes)
SurfWriter.Update()
'''

Read template image

TemplateImageType = itk.Image[PixelType, Dimension]
TemplateImageReaderType = itk.ImageFileReader[TemplateImageType]

templateImageReader = TemplateImageReaderType.New()
templateImageReader.SetFileName("F:/MIDAS_data/002/MRA/Normal002-MRA.mha")
templateImageReader.Update()
templateImage = templateImageReader.GetOutput()
###########################
#Resample = ttk.ResampleImage.New(templateImage,ResampleFactor=(2,2,2))
#Resample = ttk.ResampleImage.New(templateImage)
#Resample.SetMakeHighResIso(True)
#Resample.Update()
#image_iso = Resample.GetOutput()
##########################

TubesToImageFilterType = ttk.ConvertTubesToImage[TemplateImageType]
tubesToImageFilter = TubesToImageFilterType.New()
tubesToImageFilter.SetUseRadius(True)
tubesToImageFilter.SetTemplateImage(templateImageReader.GetOutput())
#tubesToImageFilter.SetTemplateImage(image_iso)
tubesToImageFilter.SetInput(tubes)
tubesToImageFilter.Update()
outputImage = tubesToImageFilter.GetOutput()

itk.imwrite(outputImage, 'F:/MIDAS_data/002/double_label.nii.gz')
`

I get the image( size: 448×448×128 spacing: 0.513,0.513,0.8 ) shows the label discontinuous:

111

the vtp image shows these gaps should not exist:
222

when I up-resampling the mha image to 896×896×255 ,spacing 0.257,0.257,0.4, I got the right label:

333

however, this size is too large for us to use for study.
So, Is there any way to get continuous vessel labels without upsampling? I need the continuous vessel labels with the size of 448×448×128 and spacing of 0.513,0.513,0.8.
Thank you !

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions