internal static void FillDataSet(IDicomAttributeProvider dataSet, VolumeSlice slice) { // generate values for SC Equipment Module var scEquipment = new ScEquipmentModuleIod(dataSet); scEquipment.ConversionType = @"WSD"; scEquipment.SecondaryCaptureDeviceManufacturer = @"ClearCanvas Inc."; scEquipment.SecondaryCaptureDeviceManufacturersModelName = ProductInformation.GetName(false, false); scEquipment.SecondaryCaptureDeviceSoftwareVersions = new[] { ProductInformation.GetVersion(true, true, true, true) }; // generate values for the General Image Module dataSet[DicomTags.ImageType].SetStringValue(@"DERIVED\SECONDARY"); dataSet[DicomTags.DerivationDescription].SetStringValue(@"Multiplanar Reformatting"); dataSet[DicomTags.DerivationCodeSequence].Values = new[] { ImageDerivationContextGroup.MultiplanarReformatting.AsDicomSequenceItem() }; // update the Image Plane Module dataSet[DicomTags.PixelSpacing].SetStringValue(slice.PixelSpacing); dataSet[DicomTags.ImageOrientationPatient].SetStringValue(slice.ImageOrientationPatient); dataSet[DicomTags.ImagePositionPatient].SetStringValue(slice.ImagePositionPatient); dataSet[DicomTags.SliceThickness].SetStringValue(slice.SliceThickness); // update the spacing between slices, even though it's only part of modality-specific modules dataSet[DicomTags.SpacingBetweenSlices].SetStringValue(slice.SpacingBetweenSlices); // update the Image Pixel Module dataSet[DicomTags.Rows].SetInt32(0, slice.Rows); dataSet[DicomTags.Columns].SetInt32(0, slice.Columns); // generate values for Multi-Frame Module dataSet[DicomTags.NumberOfFrames].SetInt32(0, 1); // generate values for SOP Common Module dataSet[DicomTags.SopClassUid].SetStringValue(SopClass.SecondaryCaptureImageStorageUid); dataSet[DicomTags.SopInstanceUid].SetStringValue(DicomUid.GenerateUid().UID); }
/// <summary> /// Initializes a new instance of <see cref="SopInstanceFactory"/>. /// </summary> protected SopInstanceFactory() { Manufacturer = @"ClearCanvas Inc."; ManufacturersModelName = ProductInformation.GetName(true, false); DeviceSerialNumber = string.Empty; SoftwareVersions = ProductInformation.GetVersion(true, true, true); SpecificCharacterSet = @"ISO_IR 192"; }
/// <summary> /// Constructs a new instance of <see cref="KeyImageSerializer"/>. /// </summary> /// <remarks> /// <para>Due to the relatively new nature of key object support in the Macro Framework, this API may be more prone to changes in the next release.</para> /// </remarks> public KeyImageSerializer() { _framePresentationStates = new FramePresentationList(); _datetime = Platform.Time; _author = GetUserName(); _sourceAETitle = string.Empty; _stationName = string.Empty; _institution = Institution.Empty; _manufacturer = "Macro"; _manufacturersModelName = ProductInformation.Component; _deviceSerialNumber = string.Empty; _softwareVersions = ProductInformation.GetVersion(true, true); }
/// <summary> /// Get a <see cref="UsageMessage"/> for the application. /// </summary> /// <returns> /// <para> /// A new <see cref="UsageMessage"/> object with product, region, timestamp, license, and OS information filled in. /// </para> /// <para> /// The <see cref="UsageMessage"/> instance is used in conjunction with <see cref="Register"/> to send a usage message /// to ClearCanvas servers. /// </para> /// </returns> public static UsageMessage GetUsageMessage() { UsageMessage msg; // if license key cannot be retrieved, send an empty string to maintain the existing data on the server string licenseString = String.Empty; string licenseType = String.Empty; DateTime?licenseExpiryTime = null; try { licenseString = LicenseInformation.LicenseKey; licenseExpiryTime = LicenseInformation.ExpiryTime; licenseType = LicenseInformation.LicenseType; } catch (Exception ex) { Platform.Log(LogLevel.Debug, ex, "An error has occurred when trying to get the license string"); } finally { msg = new UsageMessage { Version = ProductInformation.GetVersion(true, true), Product = ProductInformation.Product, Component = ProductInformation.Component, Edition = ProductInformation.Edition, Release = ProductInformation.Release, AllowDiagnosticUse = LicenseInformation.DiagnosticUse != LicenseDiagnosticUse.None, Region = CultureInfo.CurrentCulture.Name, Timestamp = Platform.Time, OS = Environment.OSVersion.ToString(), MachineIdentifier = EnvironmentUtilities.MachineIdentifier, MessageType = UsageType.Other, LicenseString = licenseString, LicenseType = licenseType }; if (licenseExpiryTime.HasValue) { msg.LicenseExpiryTimeUTC = licenseExpiryTime.Value.ToUniversalTime(); } } return(msg); }
public FusionSopDataSource(ISopDataSource realSopDataSource, PETFusionType type, IEnumerable <IDicomAttributeProvider> overlayFrames) { _realSopDataSource = realSopDataSource; _fusionHeaders = new DicomAttributeCollection(); var scEquipment = new ScEquipmentModuleIod(_fusionHeaders); scEquipment.ConversionType = @"WSD"; scEquipment.SecondaryCaptureDeviceManufacturer = @"ClearCanvas Inc."; scEquipment.SecondaryCaptureDeviceManufacturersModelName = ProductInformation.GetName(false, false); scEquipment.SecondaryCaptureDeviceSoftwareVersions = new[] { ProductInformation.GetVersion(true, true, true, true) }; // generate values for the General Image Module _fusionHeaders[DicomTags.ImageType].SetStringValue(@"DERIVED\SECONDARY"); _fusionHeaders[DicomTags.SourceImageSequence].Values = UpdateSourceImageSequence(realSopDataSource, overlayFrames); UpdateDerivationType(type); }
public void RunApplication(string[] args) { Console.WriteLine(@"Manifest Verification Tool"); Console.WriteLine(@" Version {0}", ProductInformation.GetVersion(true, true, true)); Console.WriteLine(@" {0}", ProductInformation.Copyright); Console.WriteLine(); Console.Write(@"Verifying... "); if (!ManifestVerification.Valid) { Console.WriteLine(@"Failed!"); Console.WriteLine(); Console.WriteLine(ManifestVerification.ErrorMessage); } else { Console.WriteLine(@"Success!"); } }
/// <summary> /// Constructs a serialization-capable DICOM softcopy presentation state object. /// </summary> /// <param name="presentationStateSopClass">The SOP class of this type of softcopy presentation state.</param> protected DicomSoftcopyPresentationState(SopClass presentationStateSopClass) { _presentationSopClass = presentationStateSopClass; _dicomFile = new DicomFile(); _serialized = false; _sourceAETitle = string.Empty; _stationName = string.Empty; _institution = Institution.Empty; _manufacturer = "Macro"; _manufacturersModelName = ProductInformation.Component; _deviceSerialNumber = string.Empty; _softwareVersions = ProductInformation.GetVersion(true, true); _presentationInstanceNumber = 1; _presentationSopInstanceUid = string.Empty; _presentationSeriesDateTime = Platform.Time; _presentationSeriesNumber = null; _presentationSeriesInstanceUid = string.Empty; _presentationLabel = "FOR_PRESENTATION"; }
private void Initialize() { // No status at first SetStatusText(string.Empty); // Initialize the version text to the executing assembly's _version.Text = String.Format(SplashScreenSettings.Default.VersionTextFormat, ProductInformation.GetVersion(true, true, true)); _copyright.Text = ProductInformation.Copyright; _license.Text = ProductInformation.License; // Make the window completely transparent Opacity = 0; // Set the manifest warning. _manifest.Visible = !ManifestVerification.Valid; // Apply any splash screen settings, if requested if (SplashScreenSettings.Default.UseSplashScreenSettings) { this.SuspendLayout(); try { var stream = SplashScreen.OpenSplashImageResourceStream(); if (stream != null) { // GDI+ resource management quirk: don't dispose the source stream (or create an independent copy of the bitmap) BackgroundImage = new Bitmap(stream); ClientSize = BackgroundImage.Size; } } catch (Exception ex) { Platform.Log(LogLevel.Warn, ex, "Failed to resolve splash screen resources."); } this._status.Visible = SplashScreenSettings.Default.StatusVisible; this._status.Location = SplashScreenSettings.Default.StatusLocation; this._status.Size = SplashScreenSettings.Default.StatusSize; this._status.AutoSize = SplashScreenSettings.Default.StatusAutoSize; this._status.ForeColor = SplashScreenSettings.Default.StatusForeColor; this._status.Font = SplashScreenSettings.Default.StatusFontBold ? new Font(this._status.Font, FontStyle.Bold) : this._status.Font; this._status.TextAlign = SplashScreenSettings.Default.StatusTextAlign; this._copyright.Visible = SplashScreenSettings.Default.CopyrightVisible; this._copyright.Location = SplashScreenSettings.Default.CopyrightLocation; this._copyright.Size = SplashScreenSettings.Default.CopyrightSize; this._copyright.AutoSize = SplashScreenSettings.Default.CopyrightAutoSize; this._copyright.ForeColor = SplashScreenSettings.Default.CopyrightForeColor; this._copyright.Font = SplashScreenSettings.Default.CopyrightFontBold ? new Font(this._copyright.Font, FontStyle.Bold) : this._copyright.Font; this._copyright.TextAlign = SplashScreenSettings.Default.CopyrightTextAlign; this._version.Visible = SplashScreenSettings.Default.VersionVisible; this._version.Location = SplashScreenSettings.Default.VersionLocation; this._version.Size = SplashScreenSettings.Default.VersionSize; this._version.AutoSize = SplashScreenSettings.Default.VersionAutoSize; this._version.ForeColor = SplashScreenSettings.Default.VersionForeColor; this._version.Font = SplashScreenSettings.Default.VersionFontBold ? new Font(this._version.Font, FontStyle.Bold) : this._version.Font; this._version.TextAlign = SplashScreenSettings.Default.VersionTextAlign; this._license.Visible = SplashScreenSettings.Default.LicenseVisible; this._license.Location = SplashScreenSettings.Default.LicenseLocation; this._license.Size = SplashScreenSettings.Default.LicenseSize; this._license.AutoSize = SplashScreenSettings.Default.LicenseAutoSize; this._license.ForeColor = SplashScreenSettings.Default.LicenseForeColor; this._license.Font = SplashScreenSettings.Default.LicenseFontBold ? new Font(this._license.Font, FontStyle.Bold) : this._license.Font; this._license.TextAlign = SplashScreenSettings.Default.LicenseTextAlign; this._manifest.Location = SplashScreenSettings.Default.ManifestLocation; this._manifest.Size = SplashScreenSettings.Default.ManifestSize; this._manifest.AutoSize = SplashScreenSettings.Default.ManifestAutoSize; this._manifest.ForeColor = SplashScreenSettings.Default.ManifestForeColor; this._manifest.Font = SplashScreenSettings.Default.ManifestFontBold ? new Font(this._manifest.Font, FontStyle.Bold) : this._manifest.Font; this._manifest.TextAlign = SplashScreenSettings.Default.ManifestTextAlign; this._pluginIconsRectangle = SplashScreenSettings.Default.PluginIconsRectangle; this._nextIconPositionX = _pluginIconsRectangle.Left + IconPaddingX / 2; this._nextIconPositionY = _pluginIconsRectangle.Top; this.ResumeLayout(); } }
public static VolumeSopDataSourcePrototype Create(IList <IDicomAttributeProvider> sourceSops, int bitsAllocated, int bitsStored, bool isSigned) { const string enumYes = "YES"; const string enumNo = "NO"; const string enumLossy = "01"; const string enumLossless = "00"; VolumeSopDataSourcePrototype prototype = new VolumeSopDataSourcePrototype(); DicomAttributeCollection volumeDataSet = prototype._collection; IDicomAttributeProvider source = sourceSops[0]; // perform exact copy on the Patient Module foreach (uint tag in PatientModuleIod.DefinedTags) { volumeDataSet[tag] = source[tag].Copy(); } // perform exact copy on the Clinical Trial Subject Module foreach (uint tag in ClinicalTrialSubjectModuleIod.DefinedTags) { volumeDataSet[tag] = source[tag].Copy(); } // perform exact copy on the General Study Module foreach (uint tag in GeneralStudyModuleIod.DefinedTags) { volumeDataSet[tag] = source[tag].Copy(); } // perform exact copy on the Patient Study Module foreach (uint tag in PatientStudyModuleIod.DefinedTags) { volumeDataSet[tag] = source[tag].Copy(); } // perform exact copy on the Clinical Trial Study Module foreach (uint tag in ClinicalTrialStudyModuleIod.DefinedTags) { volumeDataSet[tag] = source[tag].Copy(); } // perform exact copy on the General Series Module except for tags that will be overridden as part of reformatting foreach (uint tag in GeneralSeriesModuleIod.DefinedTags.Except(new[] { DicomTags.LargestPixelValueInSeries, DicomTags.SmallestPixelValueInSeries, DicomTags.SeriesInstanceUid })) { volumeDataSet[tag] = source[tag].Copy(); } // perform exact copy on the Clinical Trial Series Module foreach (uint tag in ClinicalTrialSeriesModuleIod.DefinedTags) { volumeDataSet[tag] = source[tag].Copy(); } // perform exact copy on additional modality specific modules in the series IE foreach (uint tag in ModalitySpecificSeriesModuleTags) { volumeDataSet[tag] = source[tag].Copy(); } // perform exact copy on the General Equipment Module foreach (uint tag in GeneralEquipmentModuleIod.DefinedTags) { volumeDataSet[tag] = source[tag].Copy(); } // generate values for SC Equipment Module var scEquipment = new ScEquipmentModuleIod(volumeDataSet); scEquipment.ConversionType = @"WSD"; scEquipment.SecondaryCaptureDeviceManufacturer = @"ClearCanvas Inc."; scEquipment.SecondaryCaptureDeviceManufacturersModelName = ProductInformation.GetName(true, false); scEquipment.SecondaryCaptureDeviceSoftwareVersions = new[] { ProductInformation.GetVersion(true, true, true) }; // fill series-consistent values for the Frame of Reference Module volumeDataSet[DicomTags.FrameOfReferenceUid] = source[DicomTags.FrameOfReferenceUid].Copy(); // generate values for the General Image Module var burnedInAnnotationValues = sourceSops.Select(s => s[DicomTags.BurnedInAnnotation].GetBoolean(0, enumYes, enumNo)).ToList(); var burnedInAnnotation = burnedInAnnotationValues.Any(v => v.GetValueOrDefault(false)) ? true : (burnedInAnnotationValues.All(v => !v.GetValueOrDefault(true)) ? false : (bool?)null); var recognizableVisualFeaturesValues = sourceSops.Select(s => s[DicomTags.RecognizableVisualFeatures].GetBoolean(0, enumYes, enumNo)).ToList(); var recognizableVisualFeatures = recognizableVisualFeaturesValues.Any(v => v.GetValueOrDefault(false)) ? true : (recognizableVisualFeaturesValues.All(v => !v.GetValueOrDefault(true)) ? false : (bool?)null); var lossyImageCompressionValues = sourceSops.Select(s => s[DicomTags.LossyImageCompression].GetBoolean(0, enumLossy, enumLossless)).ToList(); var lossyImageCompression = lossyImageCompressionValues.Any(v => v.GetValueOrDefault(false)) ? true : (lossyImageCompressionValues.All(v => !v.GetValueOrDefault(true)) ? false : (bool?)null); var lossyImageCompressionRatioValues = sourceSops.Select(s => s[DicomTags.LossyImageCompressionRatio].GetFloat32(0, 0)).ToList(); var lossyImageCompressionRatio = lossyImageCompressionRatioValues.Max(); volumeDataSet[DicomTags.ImageType].SetStringValue(@"DERIVED\SECONDARY"); volumeDataSet[DicomTags.DerivationDescription].SetStringValue(@"Multiplanar Reformatting"); volumeDataSet[DicomTags.DerivationCodeSequence].Values = new[] { new CodeSequenceMacro { CodingSchemeDesignator = "DCM", CodeValue = "113072", CodeMeaning = "Multiplanar reformatting" }.DicomSequenceItem }; volumeDataSet[DicomTags.BurnedInAnnotation].SetBoolean(0, burnedInAnnotation, enumYes, enumNo); volumeDataSet[DicomTags.RecognizableVisualFeatures].SetBoolean(0, recognizableVisualFeatures, enumYes, enumNo); volumeDataSet[DicomTags.LossyImageCompression].SetBoolean(0, lossyImageCompression, enumLossy, enumLossless); if (lossyImageCompressionRatio > 0) { volumeDataSet[DicomTags.LossyImageCompressionRatio].SetFloat32(0, lossyImageCompressionRatio); } // TODO: there's a SourceImageSequence here that we should probably fill out // fill series-consistent values for the Image Plane Module volumeDataSet[DicomTags.PixelSpacing] = source[DicomTags.PixelSpacing].Copy(); // fill series-consistent values for the Image Pixel Module volumeDataSet[DicomTags.SamplesPerPixel] = source[DicomTags.SamplesPerPixel].Copy(); volumeDataSet[DicomTags.PhotometricInterpretation] = source[DicomTags.PhotometricInterpretation].Copy(); volumeDataSet[DicomTags.BitsAllocated].SetInt32(0, bitsAllocated); volumeDataSet[DicomTags.BitsStored].SetInt32(0, bitsStored); volumeDataSet[DicomTags.HighBit].SetInt32(0, bitsStored - 1); volumeDataSet[DicomTags.PixelRepresentation].SetInt32(0, isSigned ? 1 : 0); // fill series-consistent values for the SOP Common Module volumeDataSet[DicomTags.SopClassUid].SetStringValue(SopClass.SecondaryCaptureImageStorageUid); return(prototype); }
public AboutForm() { this.SuspendLayout(); InitializeComponent(); _version.Text = String.Format(AboutSettings.Default.VersionTextFormat, ProductInformation.GetVersion(true, true, true)); _copyright.Text = ProductInformation.Copyright; _license.Text = ProductInformation.License; _closeButton.Text = SR.LabelClose; _manifest.Visible = !ManifestVerification.Valid; if (AboutSettings.Default.UseSettings) { try { var stream = OpenResourceStream(); if (stream != null) { // GDI+ resource management quirk: don't dispose the source stream (or create an independent copy of the bitmap) BackgroundImage = new Bitmap(stream); ClientSize = BackgroundImage.Size; } } catch (Exception ex) { Platform.Log(LogLevel.Warn, ex, "Failed to resolve about dialog resources."); } this._copyright.Location = AboutSettings.Default.CopyrightLocation; this._copyright.Size = AboutSettings.Default.CopyrightSize; this._copyright.AutoSize = AboutSettings.Default.CopyrightAutoSize; this._copyright.ForeColor = AboutSettings.Default.CopyrightForeColor; this._copyright.Font = AboutSettings.Default.CopyrightFontBold ? new Font(this._copyright.Font, FontStyle.Bold) : this._copyright.Font; this._copyright.TextAlign = AboutSettings.Default.CopyrightTextAlign; this._version.Location = AboutSettings.Default.VersionLocation; this._version.Size = AboutSettings.Default.VersionSize; this._version.AutoSize = AboutSettings.Default.VersionAutoSize; this._version.ForeColor = AboutSettings.Default.VersionForeColor; this._version.Font = AboutSettings.Default.VersionFontBold ? new Font(this._version.Font, FontStyle.Bold) : this._version.Font; this._version.TextAlign = AboutSettings.Default.VersionTextAlign; this._license.Visible = AboutSettings.Default.LicenseVisible; this._license.Location = AboutSettings.Default.LicenseLocation; this._license.Size = AboutSettings.Default.LicenseSize; this._license.AutoSize = AboutSettings.Default.LicenseAutoSize; this._license.ForeColor = AboutSettings.Default.LicenseForeColor; this._license.Font = AboutSettings.Default.LicenseFontBold ? new Font(this._license.Font, FontStyle.Bold) : this._license.Font; this._license.TextAlign = AboutSettings.Default.LicenseTextAlign; this._manifest.Location = AboutSettings.Default.ManifestLocation; this._manifest.Size = AboutSettings.Default.ManifestSize; this._manifest.AutoSize = AboutSettings.Default.ManifestAutoSize; this._manifest.ForeColor = AboutSettings.Default.ManifestForeColor; this._manifest.Font = AboutSettings.Default.ManifestFontBold ? new Font(this._manifest.Font, FontStyle.Bold) : this._manifest.Font; this._manifest.TextAlign = AboutSettings.Default.ManifestTextAlign; this._closeButton.Location = ComputeLocation(_closeButton.Size, AboutSettings.Default.CloseButtonLocation, AboutSettings.Default.CloseButtonAnchor); this._closeButton.LinkColor = AboutSettings.Default.CloseButtonLinkColor; AddExtraLabels(); } this.ResumeLayout(); this._closeButton.Click += new EventHandler(OnCloseClicked); }
private static string GetProductVersionString() { if (ProductInformation.Name.Equals(ProductInformation.Component)) { return(ProductInformation.GetNameAndVersion(false, false)); } return(string.Format("{0}\n{1}\n{2}", ProductInformation.Name, Concatenate(ProductInformation.Component, String.Format("v{0}", ProductInformation.GetVersion(false, true))), Concatenate(ProductInformation.Edition, ProductInformation.Release))); }