使用 ImageJ 显示 dicom 图像的矢状面和冠状面视图

displaying sagittal and coronal views of dicom image using ImageJ

我正在使用 ImageJ 构建一个 java 应用程序来显示 dicom 图像。 我能够导入 dicom 图像并成功显示它。但是,我也想显示图像的冠状视图和矢状视图。 这可能使用 ImageJ 吗? 使用小程序显示 dicom 图像的代码如下:

// SimpleFileChooser.java
// A simple file chooser to see what it takes to make one of these work.
//

import static com.sun.org.apache.xerces.internal.util.PropertyState.is;
import ij.plugin.DICOM;
import java.applet.Applet;
import java.awt.event.*;
import java.io.*;
import javax.swing.*;

public class readDicom extends Applet {

    public void init() {
        setSize(350, 200);

        JButton openButton = new JButton("Open");
        final JLabel statusbar
                = new JLabel("Output of your selection will go here");

        // Create a file chooser that opens up as an Open dialog
        openButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
                try {
                    JFileChooser chooser = new JFileChooser();
                    chooser.setMultiSelectionEnabled(true);
                    int option = chooser.showOpenDialog(readDicom.this);
                    if (option == JFileChooser.APPROVE_OPTION) {
                        File[] sf = chooser.getSelectedFiles();
                        String filelist = " ";
                        filelist = sf[0].getName();
                        File file = chooser.getCurrentDirectory();
                        String fullpath = file.getCanonicalPath();
                        fullpath = fullpath + "\" + filelist;
                        InputStream reader = new FileInputStream(fullpath);
                        DICOM dcm = new DICOM(reader);
                        dcm.run("Name");
                        dcm.show();
                        for (int i = 1; i < sf.length; i++) {
                            filelist += ", " + sf[i].getName();
                        }
                        statusbar.setText("You chose " + filelist);
                    } else {
                        statusbar.setText("You canceled.");
                    }
                } catch (Exception exception) {
                    exception.printStackTrace();
                }
            }
        });

        this.add(openButton);
        this.add(statusbar);
    }
}

Image > Stacks > Orthogonal Views command in ImageJ can do what you need. Have a look at the source code or the javadoc如果你想用它API.