one of my friend use mitk to develop project , and i use slicer , i want to find some ways to communicate with out output files
Slicer and MITK share a lot of the same underlying libraries but are different at the application level so many of the data structures will be different. You can probably share data objects like models and volumes, but things like transforms and markups may need converter code. They are both open source so it would be possible but I don’t recall anyone working on that kind of generic code.
i discussed with my friend with MITK and Slicer,they share a lot of libraries like ITK,VTK,CTK,DCMTK etc,but it’s different at the middle layer,we can unzip the Slicer .MRB file and unzip the MITK .mitk file to analyse the config file and load the volume and model etc, according to the config file , it’s realy a hard work!
Implementing a universal converter between the two scene file formats would not be practically feasible, because there are a lot of features and by the time you completed a converter, things would change in both applications.
However, it would be straightforward to create a converter for specific data types. Display properties are stored in xml files, which you can parse with a short Python script and write out in the other application’s format. Bulk image, mesh, etc. data are stored in the same standard file formats in both applications, so they don’t need any conversion.
What is the task you are trying to accomplish?
thank you for your advice,your method is obviously better than mine,if needed,i will take your advice , my friend has written a program use MITK old version ,it’s hard to complete complex task,so he want me to use Slicer to complete the surgical plan and export the result to his program.
finaly , thank you very much @lassoan @pieper
What kind of data you want to bring over from the old .mitk files?
If you only need to bring over segmentations then probably all you need is to extract the segment names and colors from the MITK-created file and write them back to the image header in Slicer-compatible format. You can read/write nrrd files using pynrrd and the whole processing should not take more than 20-30 lines of code. If you provide an example file then we can give tips on how to do it.
Alternatively, if you don’t want to write any custom script, you can export the segmentation in MITK to DICOM Segmentation Object. You can import these DICOM files into Slicer. This conversion should preserve segment names and colors.
we don’t want to bring over from the old .mitk files, we want to use mitk to analyse slicer files , the mitk project is a old project linked with other hardware tasks ,so we need to write code in the old mitk project ,what we can do in slicer is what we can export .
What kind of analysis would you like to do? If that is already supported in Slicer then we can help with that.
If you want to export data from Slicer then you can find the list of supported file formats here.
we want to extract the brain from T1 and get DTI model from DMRI plugin ,it can’t be done well in MITK Porject,we want export the nrrd volume ,model file and color ,position ,direction position config file from slicer and load them in MITK project,but it need many times to accomplish that
The saved nrrd image and model files can be loaded into MITK directly. I’m not sure what you mean by “color, position, direction position config file”.
yes,nrrd image and model files can be loaded into MITK directly,but the color of image,the position of image and direction of the image in slicer is represented in ColorNode and ScalarVolumeNode,in MITK represented in the DataNode Attribute,so i think it needed a config file to bridges these representations
Orientation of the image is stored in the nrrd file. What do you mean by color? The chosen lookup table or window/level?
volume color is window/level and chosen lookup table,i don’t known what the color represent in the dti model.
It may not be that important to reproduce the exact same colors. If you do want to reproduce exactly the same colors then you need to convert the color table from the text format that Slicer uses into the XML format that is used in MITK; and get the displayed scalar range from the Slicer scene (it is in the model display node) and save it in the MITK properties file.
i’am agreed with you
we will try these method you mentioned above,thank you very much