Convert JSON back to DICOM after using DCMTK’s writeJson()

I’m currently working on a websocket client/server in C++ and I need to transfer DICOM files. So, in order to send the DICOM file, I use the DCMTK function writeJson: std::ostringstream out; dcmFile.writeJson(out, DcmJsonFormatCompact(OFTrue)); m_websocketClient.send(m_hdl, out.str() , websocketpp::frame::opcode::text); On the other side, I receive a JSON looking like this: {,”00080018″:{“vr”:”UI”,”Value”:[“1.2.840.113619.2.156.8323329.4774.1574349230.940412″]},”00180086”:{“vr”:”IS”,”Value”:[0]},”00181310″:{“vr”:”US”,”Value”:[0,110,110,0]},”0020000E”:{“vr”:”UI”},”00200011″:{“vr”:”IS”,”Value”:[1]},”00200013″:{“vr”:”IS”,”Value”:[2]},”00200032″:{“vr”:”DS”,”Value”:[-109.7117,58.9065,125.4129]},”00200037″:{“vr”:”DS”,”Value”:[-0.0105,-0.0001,-0.9999,0.9999,0.0105,-0.0105]},”00201041″:{“vr”:”DS”,”Value”:[14.265837]},”00280010″:{“vr”:”US”,”Value”:[110]},”00280011″:{“vr”:”US”,”Value”:[110]},”00281050″:{“vr”:”DS”,”Value”:[548]},”00281051″:{“vr”:”DS”,”Value”:[1161]},”7fe00000″:{“vr”:”UL”},”7fe00010″:{“vr”:”OW”,”InlineBinary”:”CwAYABUA…….BQBG”}} So the data seems to…

How to deserialize Spring’s ResponseEntity with Jackson ObjectMapper (probably with using @JsonCreator and Jackson mixins)

The class ResponseEntity doesn’t have a default constructor. Then in order to deserialize it with objectMapper I decided to use the approach given by araqnid in that answer. Shortly – it needs to use mixin feature of Jackson coupled with @JsonCreator. In my case (with ResponseEntity) it doesn’t work out yet due to different reasons.…

JSONB Array Output – Postgres 11.5

I have a JSONB string in this format { “RouteId”: “90679754-89f5-48d7-99e1-5192bf0becf9”, “Started”: “2019-11-20T21:24:33.7294486Z”, “RouteName”: “ProcessRequestsAndPublishResponse”, “MachineName”: “5CG8134NJW-LA”, “ChildProfiles”: [ { “ApiMethod”: “ProcessApiRequest”, “ExecuteType”: null, “DurationMilliseconds”: 2521.4, }, { “ApiMethod”: “PublishShipViaToQueue”, “ExecuteType”: null, “DurationMilliseconds”: 0.6, } ], “DataBaseTimings”: null, “DurationMilliseconds”: 2522.6 } How do I get the output in this format | RouteName | Metrics |…

don’t see Json data result in JSP

In my .JSP file i have : <form id=”form”> <input type=”text” name=”name” id=”name”><br><br> <input type=”text” name=”address” id=”address”><br><br> <input value=”Submit” type=”submit” onclick=”submitform()”> </form> <p id=”result”></p> </body> and my Javascript function is: function submitform(){ var userName = $(‘#name’).val(); var userAdd = $(‘#address’).val(); var myVar = JSON.stringify({name: userName, address:userAdd}); $ajax({ url: ‘jsonserverlet’, type: ‘POST’, data: ‘per=’ + myVar,…

Convert JSON Array to Bash

I’m using JQ to fetch some JSON from a quiz database and I want to parse the results. I’m trying to save a resulting array in Bash as shown below but the format is that used in JavaScript/Python with square brackets rather than Bash style. quiz=$(curl -s https://opentdb.com/api.php?amount=3) answers=$(echo $quiz | jq ‘[ .results][0][0].incorrect_answers’) correct=$(echo…