protected MprSliceSet(Volume volume) { Platform.CheckForNullReference(volume, "volume"); _volume = volume.CreateTransientReference(); _sliceSops = new ObservableDisposableList<MprSliceSop>(); _sliceSops.EnableEvents = true; _sliceSops.ItemAdded += OnItemAdded; _sliceSops.ItemChanged += OnItemChanged; _sliceSops.ItemChanging += OnItemChanging; _sliceSops.ItemRemoved += OnItemRemoved; }
protected MprSliceSet(Volume volume) { Platform.CheckForNullReference(volume, "volume"); _volume = volume.CreateTransientReference(); _sliceSops = new ObservableDisposableList <MprSliceSop>(); _sliceSops.EnableEvents = true; _sliceSops.ItemAdded += OnItemAdded; _sliceSops.ItemChanged += OnItemChanged; _sliceSops.ItemChanging += OnItemChanging; _sliceSops.ItemRemoved += OnItemRemoved; }
public VolumeSliceSopDataSource(Volume volume, IVolumeSlicerParams slicerParams, IList <Vector3D> throughPoints) { Platform.CheckForNullReference(throughPoints, "throughPoints"); Platform.CheckTrue(throughPoints.Count > 0, "At least one through point must be specified."); _volumeReference = volume.CreateTransientReference(); _slicerParams = slicerParams; _resliceMatrix = new Matrix(slicerParams.SlicingPlaneRotation); _resliceMatrix[3, 0] = throughPoints[0].X; _resliceMatrix[3, 1] = throughPoints[0].Y; _resliceMatrix[3, 2] = throughPoints[0].Z; _throughPoints = new List <Vector3D>(throughPoints).AsReadOnly(); _instanceDataSet = new DicomAttributeCollection(); // JY: ideally, each slicing plane is represented by a single multiframe SOP where the individual slices are the frames. // We need to support multi-valued Slice Location in the base viewer first. // When that is implemented, the SOPs should be created on the first frame of the slicing (i.e. one of the end slices) // and the Slice Location Vector will simply store the slice locations relative to that defined in these attributes. // Also, the rows and columns will have to be computed to be the MAX possible size (all frames must have same size) // assign Rows and Columns to reflect actual output size Size frameSize = GetSliceExtent(volume, slicerParams); _instanceDataSet[DicomTags.Columns].SetInt32(0, frameSize.Width); _instanceDataSet[DicomTags.Rows].SetInt32(0, frameSize.Height); // assign Image Orientation (Patient) Matrix resliceAxesPatientOrientation = _volumeReference.Volume.RotateToPatientOrientation(_resliceMatrix); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(0, resliceAxesPatientOrientation[0, 0]); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(1, resliceAxesPatientOrientation[0, 1]); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(2, resliceAxesPatientOrientation[0, 2]); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(3, resliceAxesPatientOrientation[1, 0]); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(4, resliceAxesPatientOrientation[1, 1]); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(5, resliceAxesPatientOrientation[1, 2]); // assign Image Position (Patient) Vector3D topLeftOfSlicePatient = GetTopLeftOfSlicePatient(frameSize, throughPoints[0], volume, slicerParams); _instanceDataSet[DicomTags.ImagePositionPatient].SetFloat32(0, topLeftOfSlicePatient.X); _instanceDataSet[DicomTags.ImagePositionPatient].SetFloat32(1, topLeftOfSlicePatient.Y); _instanceDataSet[DicomTags.ImagePositionPatient].SetFloat32(2, topLeftOfSlicePatient.Z); // assign Number of Frames _instanceDataSet[DicomTags.NumberOfFrames].SetInt32(0, throughPoints.Count); // assign a new SOP instance UID _instanceDataSet[DicomTags.SopInstanceUid].SetString(0, DicomUid.GenerateUid().UID); }
public VolumeSliceSopDataSource(Volume volume, IVolumeSlicerParams slicerParams, IList<Vector3D> throughPoints) { Platform.CheckForNullReference(throughPoints, "throughPoints"); Platform.CheckTrue(throughPoints.Count > 0, "At least one through point must be specified."); _volumeReference = volume.CreateTransientReference(); _slicerParams = slicerParams; _resliceMatrix = new Matrix(slicerParams.SlicingPlaneRotation); _resliceMatrix[3, 0] = throughPoints[0].X; _resliceMatrix[3, 1] = throughPoints[0].Y; _resliceMatrix[3, 2] = throughPoints[0].Z; _throughPoints = new List<Vector3D>(throughPoints).AsReadOnly(); _instanceDataSet = new DicomAttributeCollection(); // JY: ideally, each slicing plane is represented by a single multiframe SOP where the individual slices are the frames. // We need to support multi-valued Slice Location in the base viewer first. // When that is implemented, the SOPs should be created on the first frame of the slicing (i.e. one of the end slices) // and the Slice Location Vector will simply store the slice locations relative to that defined in these attributes. // Also, the rows and columns will have to be computed to be the MAX possible size (all frames must have same size) // assign Rows and Columns to reflect actual output size Size frameSize = GetSliceExtent(volume, slicerParams); _instanceDataSet[DicomTags.Columns].SetInt32(0, frameSize.Width); _instanceDataSet[DicomTags.Rows].SetInt32(0, frameSize.Height); // assign Image Orientation (Patient) Matrix resliceAxesPatientOrientation = _volumeReference.Volume.RotateToPatientOrientation(_resliceMatrix); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(0, resliceAxesPatientOrientation[0, 0]); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(1, resliceAxesPatientOrientation[0, 1]); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(2, resliceAxesPatientOrientation[0, 2]); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(3, resliceAxesPatientOrientation[1, 0]); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(4, resliceAxesPatientOrientation[1, 1]); _instanceDataSet[DicomTags.ImageOrientationPatient].SetFloat32(5, resliceAxesPatientOrientation[1, 2]); // assign Image Position (Patient) Vector3D topLeftOfSlicePatient = GetTopLeftOfSlicePatient(frameSize, throughPoints[0], volume, slicerParams); _instanceDataSet[DicomTags.ImagePositionPatient].SetFloat32(0, topLeftOfSlicePatient.X); _instanceDataSet[DicomTags.ImagePositionPatient].SetFloat32(1, topLeftOfSlicePatient.Y); _instanceDataSet[DicomTags.ImagePositionPatient].SetFloat32(2, topLeftOfSlicePatient.Z); // assign Number of Frames _instanceDataSet[DicomTags.NumberOfFrames].SetInt32(0, throughPoints.Count); // assign a new SOP instance UID _instanceDataSet[DicomTags.SopInstanceUid].SetString(0, DicomUid.GenerateUid().UID); }
public VolumeSlicer(Volume volume, IVolumeSlicerParams slicerParams) { _volume = volume.CreateTransientReference(); _slicerParams = slicerParams; }
public VolumeSlicer(Volume vol, IVolumeSlicerParams slicerParams, string seriesInstanceUid) { _volume = vol.CreateTransientReference(); _slicerParams = slicerParams; _seriesInstanceUid = seriesInstanceUid; }
public IVolumeReference Clone() { return(_volume.CreateTransientReference()); }
public VolumeSliceSopDataSource(Volume volume, IVolumeSlicerParams slicerParams, IList <Vector3D> throughPoints) : this(volume.CreateTransientReference(), slicerParams, throughPoints) { }
public VolumeSlice(Volume volume, IVolumeSlicerParams slicerParams, Vector3D throughPoint) : this(volume.CreateTransientReference(), slicerParams, throughPoint) {}
public VolumeSlice(Volume volume, IVolumeSlicerParams slicerParams, Vector3D throughPoint) : this(volume.CreateTransientReference(), slicerParams, throughPoint) { }
public VolumeSliceSopDataSource(Volume volume, IVolumeSlicerParams slicerParams, IList<Vector3D> throughPoints) : this(volume.CreateTransientReference(), slicerParams, throughPoints) {}