Ejemplo n.º 1
0
        public void LoadTiledDataset(TiledDatasetDescription tiledDatasetDescription)
        {
            Internal.LoadTiledDataset(tiledDatasetDescription);

            if (TiledDatasetLoaded)
            {
                TiledDatasetDescription = tiledDatasetDescription;
            }
            ChangesMade = false;
        }
Ejemplo n.º 2
0
 public void LoadSegmentation(TiledDatasetDescription tiledDatasetDescription)
 {
     if (TiledDatasetLoaded)
     {
         Internal.LoadSegmentation(tiledDatasetDescription);
         if (SegmentationLoaded)
         {
             TiledDatasetDescription = tiledDatasetDescription;
         }
     }
     ChangesMade = false;
 }
Ejemplo n.º 3
0
        public void UnloadTiledDataset()
        {
            if (Internal != null)
            {
                if (SegmentationLoaded)
                {
                    UnloadSegmentation();
                }

                Internal.UnloadTiledDataset();

                if (!TiledDatasetLoaded)
                {
                    TiledDatasetDescription = new TiledDatasetDescription();
                }
            }
            NavigationControlsEnabled = false;
            ChangesMade = false;
        }
Ejemplo n.º 4
0
        public void LoadTiledDataset(string datasetRootDirectory)
        {
            if (SegmentationChangeInProgress)
            {
                return;
            }
            lock (this)
            {
                if (SegmentationChangeInProgress)
                {
                    return;
                }

                SegmentationChangeInProgress = true;

                if (TiledDatasetLoaded)
                {
                    UnloadTiledDataset();
                }

                if (!Directory.Exists(datasetRootDirectory))
                {
                    throw new Exception("Dataset directory not found.");
                }

                var sourceMapRootDirectory = Path.Combine(datasetRootDirectory, Constants.SOURCE_MAP_ROOT_DIRECTORY_NAME);

                var sourceMapTiledVolumeDescriptionPath = Path.Combine(datasetRootDirectory, Constants.SOURCE_MAP_TILED_VOLUME_DESCRIPTION_NAME);

                if (!Directory.Exists(sourceMapRootDirectory))
                {
                    throw new Exception("Image subdirectory not found.");
                }

                var sourceMapTiledVolumeDescription = GetTiledVolumeDescription(sourceMapRootDirectory, sourceMapTiledVolumeDescriptionPath);

                //
                // Read in the default idMap settings
                // Required before LoadSegmentation so that D3D11_TEXTURE3D_DESC is set correctly in TileManager.hpp
                //
                var idMapRootDirectory = Path.Combine(datasetRootDirectory, Constants.ID_MAP_ROOT_DIRECTORY_NAME);
                var idMapTiledVolumeDescriptionPath = Path.Combine(datasetRootDirectory, Constants.ID_MAP_TILED_VOLUME_DESCRIPTION_NAME);

                if (!Directory.Exists(idMapRootDirectory))
                {
                    throw new Exception("Id subdirectory not found.");
                }

                var idMapTiledVolumeDescription = GetTiledVolumeDescription(idMapRootDirectory, idMapTiledVolumeDescriptionPath);

                var tiledDatasetDescription = new TiledDatasetDescription
                {
                    TiledVolumeDescriptions =
                        new ObservableDictionary <string, TiledVolumeDescription>
                    {
                        { "SourceMap", sourceMapTiledVolumeDescription },
                        { "IdMap", idMapTiledVolumeDescription },
                        { "OverlayMap", idMapTiledVolumeDescription }
                        //,
                        //{ "TempIdMap", tempIdMapTiledVolumeDescription }
                    },
                    Paths =
                        new ObservableDictionary <string, string>
                    {
                        //{ "IdColorMap", idColorMapPath },
                    },
                    MaxLabelId = 0
                };

                LoadTiledDataset(tiledDatasetDescription);

                NavigationControlsEnabled = true;

                UpdateView();

                ChangesMade = false;

                SegmentationChangeInProgress = false;
            }
        }
Ejemplo n.º 5
0
        public void LoadTiledDataset( TiledDatasetDescription tiledDatasetDescription )
        {
            Internal.LoadTiledDataset( tiledDatasetDescription );

            if ( TiledDatasetLoaded )
            {
                TiledDatasetDescription = tiledDatasetDescription;
            }
            ChangesMade = false;
        }
Ejemplo n.º 6
0
        public void LoadTiledDataset( string datasetRootDirectory )
        {
            if ( SegmentationChangeInProgress ) return;
            lock ( this )
            {
                if ( SegmentationChangeInProgress ) return;

                SegmentationChangeInProgress = true;

                if ( TiledDatasetLoaded )
                {
                    UnloadTiledDataset();
                }

                if ( !Directory.Exists( datasetRootDirectory ) )
                {
                    throw new Exception( "Dataset directory not found." );
                }

                var sourceMapRootDirectory = Path.Combine( datasetRootDirectory, Constants.SOURCE_MAP_ROOT_DIRECTORY_NAME );

                var sourceMapTiledVolumeDescriptionPath = Path.Combine( datasetRootDirectory, Constants.SOURCE_MAP_TILED_VOLUME_DESCRIPTION_NAME );

                if ( !Directory.Exists( sourceMapRootDirectory ) )
                {
                    throw new Exception( "Image subdirectory not found." );
                }

                var sourceMapTiledVolumeDescription = GetTiledVolumeDescription( sourceMapRootDirectory, sourceMapTiledVolumeDescriptionPath );

                //
                // Read in the default idMap settings
                // Required before LoadSegmentation so that D3D11_TEXTURE3D_DESC is set correctly in TileManager.hpp
                //
                var idMapRootDirectory = Path.Combine( datasetRootDirectory, Constants.ID_MAP_ROOT_DIRECTORY_NAME );
                var idMapTiledVolumeDescriptionPath = Path.Combine( datasetRootDirectory, Constants.ID_MAP_TILED_VOLUME_DESCRIPTION_NAME );

                if ( !Directory.Exists( idMapRootDirectory ) )
                {
                    throw new Exception( "Id subdirectory not found." );
                }

                var idMapTiledVolumeDescription = GetTiledVolumeDescription( idMapRootDirectory, idMapTiledVolumeDescriptionPath );

                var tiledDatasetDescription = new TiledDatasetDescription
                                              {
                                                  TiledVolumeDescriptions =
                                                      new ObservableDictionary<string, TiledVolumeDescription>
                                                      {
                                                          { "SourceMap", sourceMapTiledVolumeDescription },
                                                          { "IdMap", idMapTiledVolumeDescription },
                                                          { "OverlayMap", idMapTiledVolumeDescription }
                                                          //,
                                                          //{ "TempIdMap", tempIdMapTiledVolumeDescription }
                                                      },
                                                  Paths =
                                                      new ObservableDictionary<string, string>
                                                      {
                                                          //{ "IdColorMap", idColorMapPath },
                                                      },
                                                  MaxLabelId = 0
                                              };

                LoadTiledDataset( tiledDatasetDescription );

                NavigationControlsEnabled = true;

                UpdateView();

                ChangesMade = false;

                SegmentationChangeInProgress = false;
            }
        }
Ejemplo n.º 7
0
 public void LoadSegmentation( TiledDatasetDescription tiledDatasetDescription )
 {
     if ( TiledDatasetLoaded )
     {
         Internal.LoadSegmentation( tiledDatasetDescription );
         if ( SegmentationLoaded )
         {
             TiledDatasetDescription = tiledDatasetDescription;
         }
     }
     ChangesMade = false;
 }
Ejemplo n.º 8
0
        public void UnloadTiledDataset()
        {
            if ( Internal != null )
            {
                if ( SegmentationLoaded )
                {
                    UnloadSegmentation();
                }

                Internal.UnloadTiledDataset();

                if ( !TiledDatasetLoaded )
                {
                    TiledDatasetDescription = new TiledDatasetDescription();
                }
            }
            NavigationControlsEnabled = false;
            ChangesMade = false;
        }