VTI Sizing Issue - macOS version 11.2.3 - SV version 2021.02.06

Provides a system for patient-specific cardiovascular modeling and simulation.
User avatar
Jessica Blair
Posts: 37
Joined: Thu Sep 19, 2019 6:09 pm

VTI Sizing Issue - macOS version 11.2.3 - SV version 2021.02.06

Post by Jessica Blair » Tue Apr 13, 2021 9:04 pm

Hello all,
I was wondering if anyone has had issues with downloading DICOM images into SimVascular.
For instance, on my end, one DICOM image is on a different plane than the other 9 DICOM images, shown below. On my mentor's end, they are on the correct plane. I have downloaded the DICOM images through our shared link.
Thank you for your time!

Take care and stay healthy,
Jessica
Attachments
differentplanes.png
differentplanes.png (229.93 KiB) Viewed 353 times

User avatar
David Parker
Posts: 1699
Joined: Tue Aug 23, 2005 2:43 pm

Re: VTI Sizing Issue - macOS version 11.2.3 - SV version 2021.02.06

Post by David Parker » Wed Apr 14, 2021 12:27 pm

Hi Jessica,

Looking at the attached picture it seems that you have two SV projects loaded. I think this is causing problems with the image slice plane, doesn't know which image to use maybe.

Cheers,
Dave

User avatar
Jessica Blair
Posts: 37
Joined: Thu Sep 19, 2019 6:09 pm

Re: VTI Sizing Issue - macOS version 11.2.3 - SV version 2021.02.06

Post by Jessica Blair » Wed Apr 21, 2021 12:35 pm

Hi David,

Yes, I had two projects open just to show the differences in the 3D planes for each project. When I import these models to ParaView, they are still on different planes. The original hope was to use all 10 models for the valves on this patient, and create an animation with the surface models created from SimVascular. Unfortunately, the models for the 10% are different than the 20-100% models. I have attached a screenshot of the exported surface models in ParaView.

Thank you!
Attachments
Screen Shot 2021-04-21 at 12.35.17 PM.png
Screen Shot 2021-04-21 at 12.35.17 PM.png (36.15 KiB) Viewed 310 times

User avatar
David Parker
Posts: 1699
Joined: Tue Aug 23, 2005 2:43 pm

Re: VTI Sizing Issue - macOS version 11.2.3 - SV version 2021.02.06

Post by David Parker » Thu Apr 22, 2021 10:49 am

Hi Jessica,

This seems to be caused either from different scaling or that the origin is different for the two images. You can look at the header of the .vti file to see this

Code: Select all

more demo.vti

<?xml version="1.0"?>
<VTKFile type="ImageData" version="0.1" byte_order="LittleEndian" compressor="vtkZLibDataCompressor">
  <ImageData WholeExtent="0 511 0 63 0 511" Origin="-20.3961 -5.11 -22.9461" Spacing="0.078125 0.2 0.078125">

If you upload the image .vti files someplace I can download them I'll have a look.

Cheers,
Dave

User avatar
Jessica Blair
Posts: 37
Joined: Thu Sep 19, 2019 6:09 pm

Re: VTI Sizing Issue - macOS version 11.2.3 - SV version 2021.02.06

Post by Jessica Blair » Thu Apr 22, 2021 11:46 am

Hi Dave,

Thank you for the reply. I was viewing the bounds for each VTI image on ParaView and noticed that the 20-100% X, Y, and Z bounds start at a negative number instead of starting at 0 as the bounds for 10% X, Y, and Z do. How would I view the header of .vti file?
I have emailed you both VTI files and appreciate your feedback and help. :D

User avatar
David Parker
Posts: 1699
Joined: Tue Aug 23, 2005 2:43 pm

Re: VTI Sizing Issue - macOS version 11.2.3 - SV version 2021.02.06

Post by David Parker » Thu Apr 22, 2021 12:32 pm

Hi Jessica,

You can use the Linux more command to look at the .vti headers.

The two images do indeed have different origins

Code: Select all

$ more TAV_110%.vti
<?xml version="1.0"?>
<VTKFile type="ImageData" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
  <ImageData WholeExtent="0 511 0 511 0 223" Origin="-67.100997925 -103.94000244 -214.07600403" Spacing="0.332031 0.332031 0.625">

$ more TAV_20%.vti 
<?xml version="1.0"?>
<VTKFile type="ImageData" version="0.1" byte_order="LittleEndian" header_type="UInt32" compressor="vtkZLibDataCompressor">
  <ImageData WholeExtent="0 511 0 511 0 223" Origin="0 0 0" Spacing="0.332031 0.332031 0.625">
You can change the image origin using the SV Python API. See https://github.com/SimVascular/SimVascu ... -origin.py

Cheers,
Dave

User avatar
Jessica Blair
Posts: 37
Joined: Thu Sep 19, 2019 6:09 pm

Re: VTI Sizing Issue - macOS version 11.2.3 - SV version 2021.02.06

Post by Jessica Blair » Thu Apr 22, 2021 2:28 pm

Hi Dave,

I am actually not too familiar with GitHub. I have created an account and opened the app on the desktop, trying to run via my terminal (I have a Mac) and the command line won't run. On the code in the GitHub app I cannot edit anything either, but I see where I should be able to put the name for my .vti folder.
I opened textedit to adjust the line with "write_file_name" and copy and pasted this to my terminal, but it still wouldn't run.
Sorry for the inconvenience! I looked online but am still having trouble, do you have any suggestions?

Thank you in advance.

User avatar
David Parker
Posts: 1699
Joined: Tue Aug 23, 2005 2:43 pm

Re: VTI Sizing Issue - macOS version 11.2.3 - SV version 2021.02.06

Post by David Parker » Fri Apr 23, 2021 12:28 pm

Hi Jessica,

You should spend a little time learning how to use git; it is very useful! I've added a Python script here https://github.com/ktbolt/cardiovascula ... gin/python

To get a copy of the Python script execute the following command in a terminal

Code: Select all

git clone https://github.com/ktbolt/cardiovascular
The script is in the cardiovascular/set-image-origin/python directory.

You will need VTK installed to run this script: pip install vtk

Cheers,
Dave

User avatar
Jessica Blair
Posts: 37
Joined: Thu Sep 19, 2019 6:09 pm

Re: VTI Sizing Issue - macOS version 11.2.3 - SV version 2021.02.06

Post by Jessica Blair » Sun Apr 25, 2021 6:09 pm

Hi Dave,

I'll take a look at that and adjust if need be. Thank you for the links!

Take care and stay healthy,
Jessica

User avatar
Justin Mel Cortez
Posts: 2
Joined: Wed Sep 30, 2020 12:16 pm

Re: VTI Sizing Issue - macOS version 11.2.3 - SV version 2021.02.06

Post by Justin Mel Cortez » Wed Oct 27, 2021 9:32 pm

Hey David,

I was able to run the code you provided in PyCharm and it was successfully able to reset the coordinates properly for the .vti files. Is there a chance that the code can be edited so that it could also translate other files, such as the path (.pth) and segmentation (.ctgr) files as well? Or will I have to manually redo all of the segmentations and paths with this newly translated image?

Thanks all,
Justin

POST REPLY