DevelopmentalImagingMCRI / karawun

Convert tractography studies from mrtrix into dicom for use in navigation software
Apache License 2.0
14 stars 4 forks source link

Compatibility #11

Closed treanus closed 3 years ago

treanus commented 4 years ago

Hi,

thank you for making available karawun.

I would like to know whether is works with iplan view/cranial version 3.0 and/or with Philips dicom data as template?

Thx, Best regards,

Stefan.

richardbeare commented 4 years ago

Hi, Thanks for your interest. We are using the same version of iplan, so can confirm that part works. We have a Siemens scanner and have not tested Philips dicom, however I do not anticipate any problems. The dicom template is used as a source of information that isn't available in the nifti files, and karawun does that by copying tags across. This ought to be quite vendor independent, provided there's nothing in private tags that your installation of brainlab looks for.

treanus commented 4 years ago

Hi,

I was able to create the dicoms.

Important seems to be to convert the Philips multiframe enhanced dicom to a single frame dicom and only provide one slice to importTractgraphy as the dicom_template.

I still am not able to import the tracts in Iplan. The converted nii files get imported well. The tracts not. The iplan log-file reads: "Ignoring Dicom image series 'x' with modality 'SEG'", which is of course the problem. Did you change anything to iplan?

Thx, Best regards,

Stefan.

richardbeare commented 4 years ago

That sounds like progress. We don't import direct to iPlan, but use the the main brainlab interface that provides patient selection icons as well as the choice of different brainlab tools, including iPlan and the image viewer. As a test, are you able to see the tracts in the image viewer? The viewer ought to be able to display the tracts in 3D, but only overlaying the reference image. You need to accept registration via the image fusion module in order to overlay on arbitary images. Also, are you able to show your conversion commandline? It sounds as though it is fine, but worth checking to make sure.

We might need to generate some more screenshots to guide the process.

treanus commented 4 years ago

Hi Richard,

thank you for the quick response!

The conversion command look as follows: importTractography -d Anonymized\ -\ 75320796/Rad\ Mr\ Taxie\ 01/Single\ -\ 8269/IM-0001-0001-0001.dcm -o iplan2 -n anat.nii.gz fa_reg2T1w.nii.gz -t DRT_L_select250000_incRN.tck DRT_R_select250000_incRN.tck -v

with:

Then, I use the following brainlab tools iPlan View 3.0 and/or iPlan Cranial 3.0 (see screenshot):

Schermafbeelding 2020-07-31 om 15 19 01 The iplan 2 output is copied the f:\PatientData\mrtrix folder.

PatientName and ID are recognised: Schermafbeelding 2020-07-31 om 15 19 23

The tracts do not load. The log-file shows: Schermafbeelding 2020-08-01 om 12 42 33

I could share my data with you, if that helps.

Thx in advance,

Stefan.

treanus commented 4 years ago

Just another point: I had to rescale the anatomical image.

My original T1 is a float 32, which a large intensity range. See screenshot.

Schermafbeelding 2020-08-01 om 13 02 46

If I use that one, import fails:

Traceback (most recent call last):
  File "/Users/xm52195/anaconda3/envs/KarawunEnv/lib/python3.6/site-packages/pydicom/tag.py", line 30, in tag_in_exception
    yield
  File "/Users/xm52195/anaconda3/envs/KarawunEnv/lib/python3.6/site-packages/pydicom/filewriter.py", line 541, in write_dataset
    write_data_element(fp, dataset.get_item(tag), dataset_encoding)
  File "/Users/xm52195/anaconda3/envs/KarawunEnv/lib/python3.6/site-packages/pydicom/filewriter.py", line 483, in write_data_element
    writer_function(buffer, data_element, writer_param)
  File "/Users/xm52195/anaconda3/envs/KarawunEnv/lib/python3.6/site-packages/pydicom/filewriter.py", line 232, in write_numbers
    "{0}\nfor data_element:\n{1}".format(str(e), str(data_element)))
OSError: ushort format requires 0 <= number <= (32767 *2 +1)

I just rescaled using the command:

mrcalc T1w_BrainExtractionBrain.nii.gz 100 -div anat.nii.gz

Than importTractography works fine.

richardbeare commented 4 years ago

Sensible autoscaling of scans was something I ended up avoiding, but there probably should be some more checking. I did try using floats, but that is not part of the dicom standard. I also looked at slice dependent scaling, but that isn't either.

We don't import via iplan. We enter via "origin server", at least that is what it is called in our install: origin_serverA

Then we go into "patient selection" and there's a manage dropdown on the right with an upload option: origin_serverB

We upload our exported dicoms from the local machine to the server using that option, and we can use the karawun output in the previewing and image fusion tools before going into iplan cranial.

Does your installation look the same?

I am happy to try out your data if you still have problems.

treanus commented 4 years ago

Thank you!

We need to upgrade to "origin server".

I'll keep you updated.

Best regards,

Stefan