[vtk-developers] Parsing and reading json files

Andras Lasso lasso at queensu.ca
Tue Dec 12 09:20:22 EST 2017


Jsoncpp works and it’s already added in VTK, so it is a convenient choice. However, we’ve found that if you work with large documents then it is unbearably slow (not just parsing, but accessing data in memory). For large files, I would recommend RapidJSON instead.

Some advantages of RapidJSON:


-          Magnitudes faster, also, its API facilitates writing efficient application code (although this API is also a bit more complex than jsoncpp)

-          CMake-ified

-          Header-only (no need to install DLLs, ...)

-          More conform to json standard

-          Library is much smaller (31k vs 243k)

Some more background:
https://github.com/Slicer/Slicer/pull/646

Andras

From: vtk-developers [mailto:vtk-developers-bounces at vtk.org] On Behalf Of Will Schroeder
Sent: Tuesday, December 12, 2017 9:09 AM
To: vtk-developers <vtk-developers at vtk.org>
Subject: [vtk-developers] Parsing and reading json files

Background:
I am working with a research team performing biological simulation (UConn fungal simulation<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fresearch.uconn.edu%2F2017%2F10%2F19%2Fuconn-healthjax-faculty-wins-2-7m-grant-to-develop-better-tools-for-biomedical-modeling%2F&data=02%7C01%7Classo%40queensu.ca%7C89e840b968aa4141447e08d54169ed9f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636486845569042193&sdata=3eTq%2BjY3MolCl89bBFHpTW5A4WM3YL5srZRJ2yy%2BOns%3D&reserved=0>). Their simulation code (NetLogo<https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fccl.northwestern.edu%2Fnetlogo%2F&data=02%7C01%7Classo%40queensu.ca%7C89e840b968aa4141447e08d54169ed9f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636486845569042193&sdata=%2B7qG4nmn21dKirqdjt38h7JouwBl%2FsnDxl%2BzkvvCwO8%3D&reserved=0>) has been instrumented to output JSON files for the purposes of visualization.

Advice needed:
We need to read their data so I intend to write a VTK reader to parse these JSON files. It appears that "VTK/ThirdParty/jsoncpp" is the way to go, please correct me if I am wrong and/or offer an alternate approach.

Best,
W



--
William J. Schroeder, PhD
Kitware, Inc. - Building the World's Technical Computing Software
28 Corporate Drive
Clifton Park, NY 12065
will.schroeder at kitware.com<mailto:will.schroeder at kitware.com>
http://www.kitware.com<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.kitware.com&data=02%7C01%7Classo%40queensu.ca%7C89e840b968aa4141447e08d54169ed9f%7Cd61ecb3b38b142d582c4efb2838b925c%7C1%7C0%7C636486845569042193&sdata=AodQJJA0zEuInutPR23xmj9LgqQVXJwSet%2BpCItw4fM%3D&reserved=0>
(518) 881-4902
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20171212/82bc3f5d/attachment.html>


More information about the vtk-developers mailing list