How to use XTK read arrayBuffer data - dicom

I would like to know how to read arrayBuffer data (DICOM arrayBuffer) by using XTK library. I have already tried lots methods, but do not work.

I have found a solution.
http://jsfiddle.net/73av5041/3/
shows that volume.file can be a array of name files. Then put the arrayBuffer data into volume.filedata directly. Keep the number of files and the length of arrayBuffer same.

Related

Using U-SQL MultiLevelJsonExtractor gives Error: Path returned multiple tokens

I am using the MultiLevelJsonExtractor forked on Git by kotvisbj, When I put a Path that contains an array (body.header.items[*] or body.header.items) into the JsonPaths parameter string, I get a "Error: Path returned multiple tokens". Is there a way to extract the paths in code so I can get an array like when using the Root? I tried to explain this the best way I could, I don't have excellent c# skills, it's been a few years.
I think it would be best to ask the owner of the branch to see if he can advise you. I assume that his code expects a single token only and not an array of tokens.
You can probably achieve what you need by using code similar to this: U-SQL - Extract data from json-array

function with .DATA how to convert to byte array

Sorry for the Noob Question.
I have a library - RFM69 - https://github.com/LowPowerLab/RFM69
This provides the output as .DATA this appears to be a built in type?
Second I am trying send .DATA as a byte array but don't know what type it is in the first place. How can I find out.
Open the repository on GitHub. https://github.com/LowPowerLab/RFM69
Use the search field in the upper right ( with the in repository option) and search for ".DATA"
This will give you any file that contains it. Within seconds you'll find out that DATA is a member of the class RFM69 which is defined in the file RFM69.h
You got the full source code. All you have to do is search, read and understand parts of it to get any answer you need.
https://github.com/LowPowerLab/RFM69/blob/master/RFM69.h
static volatile uint8_t DATA[RF69_MAX_DATA_LEN]; // recv/xmit buf, including header & crc bytes
I'll leave the rest to you.

Appending new frames to an existing DICOM file

I am working with DCMTK to modify an input DICOM file.
This is a Multi-Frame DICOM file on my disk. I need to add new frames into the PixelData element, and save the output using the same input filename.
The restriction is that I can not load the whole PixelData in memory. I would like to append new frame to the end of DICOM file, directly. Does anyone have any idea on how to do this ?
Too bad you are using DCMTK, if instead you were using GDCM, you could simply instantiate the FileStreamer class and append any Pixel Data chunk you would like:
See FileStreamer documentation.

highcharts prepare options for POST

I need to send a Highcharts options object to an asp page so it can be written to a json flat file. These files are later passed to phantomjs via highcharts-convert in order to create some pdfs.
The problem however is stringifying the objects. I keep getting this error:
Uncaught TypeError: Converting circular structure to JSON
when I try this:
$.post("myASP.asp", JSON.stringify(myChart.highcharts().options));
There is a sample POST string here http://docs.highcharts.com/#render-charts-on-the-server but I'm not sure how to achieve that with mine. When I paste their sample into my code for testing I get all kinds of unescaped double quote errors. Is that a typo on their part?
I would check if there are curricular references in the JSON objects. As far as I remember that is not supported by the JSON serializer.
One example of this if you have an object with an array of children that refer back to the parent.
I think you can try the following:
{"infile":myChart.getSVG()}
This should get the svg representation of the chart

check uploaded file in vb.net

I need a snippet to check file for validity (I'm allowing users to upload xml files). So I need to check whether uploaded file is XML.
The best I can think of is just check if extension is ".xml". What if its replaced?
You can try loading it like this and catch the exception:
XDocument xdoc = XDocument.Load("data.xml"));
Presumably, if they're uploading XML, then you're going to use it for something afterwards. In this case you should validate the XML against a Schema (XSD etc) so that you know you aren't going to hit unexpected values/layouts etc.
In Urlmon.dll, there's a function called FindMimeFromData.
From the documentation
MIME type detection, or "data
sniffing," refers to the process of
determining an appropriate MIME type
from binary data. The final result
depends on a combination of
server-supplied MIME type headers,
file extension, and/or the data
itself. Usually, only the first 256
bytes of data are significant.
So, read the first (up to) 256 bytes from the file and pass it to FindMimeFromData.
If you must validate the xml (assuming you want to validate the entire thing) you can use the XmlDocument class and catch an exception if it's not XML.

Resources