I am using the Markups and VMTK module for blood vessel centerline extraction. In the markups module, is there a method to save the blood vessel radius at each node to a file such as JSON or fcsv? In the scalars section, by selecting the radius, I get a color gradient in the 3D view so can I save the node-specific values to a file?
Upon saving the centerline fcsv file the Control Points table values are saved. So is there a way to incorporate the radius at each node also in this file?
You can get the diameter at each curve/model point with ‘Cross-section analysis’ module. It allows to show a table widget where you can select and copy data of your interest. Please note that each line corresponds to data measured at each curve/model point, not at curve control points.
If you really need these in the markups storage file, you would need to write some Python code for this specific task. I don’t think it would be wise to expect the markups module to do that, markups being context and purpose agnostic.
@chir.set Ok, thanks a lot I’ll try this out. Also, I have noticed that while saving a centerline curve as JSON, the radius values in the file do not accommodate for point resampling. For example, if a curve had 50 points initially and I resample to 20, the generated JSON file still shows the data for the original 50 points in regards to the radius. I don’t know if it’s some mistake that I’m making. I’m not able to figure this out.
Ha, this discussion shows me that the radius at each control point is already saved in the JSON file, so you don’t have any problem with your initial question :
I cannot confirm that. I just tried resampling a centerline curve from 22 to 15, 20, 5 control points and saved it each time. The JSON file remains coherent each time regarding the radius. Try with latest nightly build.
Hi @chir.set while downsampling works just fine, upon upsampling I lose all the radius data. By upsampling from 20 to 25 control points if I save the JSON file, no radius values are given. Also upon running Cross-Sectional Analysis on the upsampled 25 points, only the point coordinates are displayed. The MIS diameter field remains blank.
Is there any way to solve this?
I have tried Cross-Sectional Analysis on downsampled points and it works just fine. I’m using the latest preview version.
I’m afraid I have not observed this. I just tried resampling a 63 control points markups curve to 100, after re-applying in ‘Cross-section analysis’, all metrics are rightly displayed. Using 4.13.0-2021-12-31 r30519 / 5ea103f.
I didn’t find anything wrong in the workflow itself. Repeating the same steps, I could not confirm your findings with an input model surface. The MIS diameter is always reported when the input curve is over sampled, or down sampled.
But I did found another problem. The module’s logic assumes that the input surface is always a segmentation node, while you are using an input model surface. This is a separate problem, I’ll fix it ASAP.
Also, I have noticed that the centerline curves with sharp nodes such as those in Centerline Curve (1) have this issue of not generating radius upon upsampling.
I don’t know how but the Centerline Curve (0) has curved changes at nodes and this one works fine upon upsampling as you had mentioned. So is there a method to convert the sharp nodes of Centerline Curve (1) to be the same as those of Centerline Curve (0)? I don’t see any differences in their properties.
Hi @lassoan. Apologies for the delayed response. The problem does not occur when I separately load a centerline curve file. Upon loading the files separately, each centerline curve has non-static control points. But if I perform Centerline Extraction and then immediately try to modify the control points, I face this issue. Only the 0th centerline curve is non-static and works as it is supposed to. The rest are composed of static control points and show problems. Then when I save these files and load them again, they all are non-static and work fine.