import java.io.File;
import com.aspose.imaging.Image;
import com.aspose.imaging.imageoptions.*;

//You can get all image templates from https://github.com/aspose-imaging/Aspose.Imaging-for-Java/blob/master/Examples/Data/Templates.zip
//After download archive please unpack it and replace templatesFolder variable path with your path to unpacked archive folder
public class Main {
  public static void main(String[] args) {
    // get path of the input data
    String templatesFolder = System.getenv("DATA_PATH");
    // get output path
    String outputFolder = System.getenv("OUT_PATH");

    if (templatesFolder == null)
       templatesFolder = "data";

    if (outputFolder == null)
      outputFolder = "out";

    // Load the dicom file in an instance of Image
    try (Image image = Image.load(templatesFolder + File.separator + "template.dicom")) {
      DxfOptions exportOptions = new DxfOptions();
      // Save dicom to dxf
      image.save(outputFolder + File.separator + "dicom-to-dxf-output.dxf", exportOptions);
    }
  }
}