Code Monkey home page Code Monkey logo

Comments (8)

cpinter avatar cpinter commented on June 26, 2024

In the above screenshot you export the study. In your script, you try to export only the segmentation, instead of the study, which would be the correct way.

We prefer questions asked in the Slicer discourse forum for better visibility. Here please report bugs. Thank you.

from slicerrt.

Namng1210 avatar Namng1210 commented on June 26, 2024

Can you give me an instruction how to export study with DicomRTImportExportPlugin in Python Script. I've tried many ways but still can't make it. :(

from slicerrt.

cpinter avatar cpinter commented on June 26, 2024

As I said you try to export the segmentation: exporter.examineForExport(segmentationShItem)
and instead you need to export the study: exporter.examineForExport(studyShItem)

from slicerrt.

Namng1210 avatar Namng1210 commented on June 26, 2024

exportable

Yes i've also tried it but here is the result. When i checked source code it seems like dataNode can't read the studyID.. so it return nothing in exportables...

from slicerrt.

cpinter avatar cpinter commented on June 26, 2024

I see. It seems you need to run the examineForExport function on all the series you want to export (the segmentation and the CT), collect the returned exportables in a list, and and pass that list for the export function.

At least this is what the GUI does, see
https://github.com/Slicer/Slicer/blob/master/Modules/Scripted/DICOMLib/Widgets/qSlicerDICOMExportDialog.cxx#L271

from slicerrt.

Namng1210 avatar Namng1210 commented on June 26, 2024

OMG! It was actually worked ! Thanks you so much for helping for me <3

from slicerrt.

cpinter avatar cpinter commented on June 26, 2024

Perfeft, thank you! Closing the issue then.

from slicerrt.

roger-sun avatar roger-sun commented on June 26, 2024

Hello,
I am kinda new with python. Can you explain to me how you manage to solve this issue?

I tried to run the ExamineForExport function on the volume and the segmentations, then past them in a list for the export function, but it did not worked:

exporter = DicomRtImportExportPlugin.DicomRtImportExportPluginClass()
exportable1 = exporter.examineForExport(segmentationShItem)
exportable2 = exporter.examineForExport(referenceVolumeShItem)

for exp in exportable1:
exp.directory=outputFolder
for exp in exportable2:
exp.directory=outputFolder

exportables = [exportable1,exportable2]

exporter.export(exportables)
Traceback (most recent call last):
File “”, line 1, in
File “C:/Users/tmp/AppData/Roaming/NA-MIC/Extensions-29402/SlicerRT/lib/Slicer-4.11/qt-scripted-modules/DicomRtImportExportPlugin.py”, line 122, in export
exportable.copyToVtkExportable(vtkExportable)
AttributeError: ‘list’ object has no attribute ‘copyToVtkExportable’

thanks !

from slicerrt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.