Ejemplo n.º 1
0
void CTexturePropDlg::OnPrefer5551()
{
	if(m_bTFormatChanges)
	{
		SetChange(IDC_PREFER5551, TPROP_PREFER5551);

		// Force 4444 off.
		m_bTFormatChanges = FALSE;
			m_Prefer4444.SetCheck(FALSE);
			SetChange(IDC_PREFER4444, TPROP_PREFER4444);
		m_bTFormatChanges = TRUE;
	}
}
Ejemplo n.º 2
0
void CTexturePropDlg::OnFormatDxt5()
{
	SetChange(IDC_DATAFORMAT, TPROP_DATAFORMAT);
	m_BPPIdent = BPP_S3TC_DXT5;
	SetupBPPIdent();
	RedrawPreviewWindow();
}
Ejemplo n.º 3
0
void CTextureProp::OnFormat32bit() 
{
	SetChange(IDC_DATAFORMAT, TPROP_DATAFORMAT);
	m_BPPIdent = BPP_32;
	SetupBPPIdent();
	RedrawPreviewWindow();
}
Ejemplo n.º 4
0
void CSEdOpenedFiles::SetCompileFile(CSEdScriptEdit* cf)
{
	if(compfile==cf) return;

	SetChange();

	compfile = cf;

	CSEdOpenFilesListIt iter(GetOpenedFiles());
	CSEdScriptEdit *se;

	while(!iter.End())
	{
        se = iter->GetScriptEdit();
		if(se)
			se->ShowCurCompFile();
		
		iter++;
	}

	CompileForOB();
}
Ejemplo n.º 5
0
void CTexturePropDlg::OnChangeTexturePriority()
{
	SetChange(IDC_PRIORITY_LABEL, TPROP_TEXTUREPRIORITY);
}
Ejemplo n.º 6
0
void CTexturePropDlg::OnUIMipmapOffset()
{
	SetChange(IDC_UIMIPMAPOFFSET_LABEL, TPROP_UIMIPMAPOFFSET);
}
Ejemplo n.º 7
0
void CTexturePropDlg::OnNonS3TCMipmapOffset()
{
	SetChange(IDC_DTX_NONS3TCMIPMAPOFFSET_LABEL, TPROP_NONS3TCMIPMAPOFFSET);
}
Ejemplo n.º 8
0
void CTexturePropDlg::OnChangeDtxCommandString()
{
	SetChange(IDC_DTX_COMMAND_STRING_LABEL2, TPROP_COMMANDSTRING);
}
Ejemplo n.º 9
0
void CTexturePropDlg::OnNoSysCache()
{
	SetChange(IDC_NOSYSCACHE, TPROP_NOSYSCACHE);
}
void DataManager::Initialize(itk::SmartPointer<LabelMapType> labelMap, std::shared_ptr<Coordinates> coordinates, std::shared_ptr<Metadata> metadata)
{
  m_orientationData = coordinates;
  auto spacing      = m_orientationData->GetImageSpacing();
  auto imageorigin  = m_orientationData->GetImageOrigin();
  auto imagesize    = m_orientationData->GetImageSize();

  // insert background label info, initially all voxels are background, we'll subtract later
  auto object = std::make_shared<ObjectInformation>();
  object->scalar   = 0;
  object->centroid = Vector3d((imagesize[0] / 2.0) * spacing[0], (imagesize[1] / 2.0) * spacing[1], (imagesize[2] / 2.0) / spacing[2]);
  object->size     = imagesize[0] * imagesize[1] * imagesize[2];
  object->min      = Vector3ui(0, 0, 0);
  object->max      = Vector3ui(imagesize[0], imagesize[1], imagesize[2]);

  ObjectVector.insert(std::pair<unsigned short, std::shared_ptr<ObjectInformation>>(0, object));

  // evaluate shapelabelobjects to get the centroid of the object
  auto evaluator = itk::ShapeLabelMapFilter<LabelMapType>::New();
  evaluator->SetInput(labelMap);
  evaluator->ComputePerimeterOff();
  evaluator->ComputeFeretDiameterOff();
  evaluator->SetInPlace(true);
  evaluator->Update();

  // get voxel count for each label for statistics and "flatten" the labelmap (make all labels consecutive starting from 1)
  auto labelChanger = ChangeType::New();
  labelChanger->SetInput(evaluator->GetOutput());
  labelChanger->SetInPlace(true);

  ImageRegionType region;
  unsigned short i = 1;
  itk::Point<double, 3> centroid;

  for (int i = 0; i < evaluator->GetOutput()->GetNumberOfLabelObjects(); ++i)
  {
    auto labelObject = evaluator->GetOutput()->GetNthLabelObject(i);
    auto scalar = labelObject->GetLabel();
    centroid = labelObject->GetCentroid();
    region = labelObject->GetBoundingBox();
    auto regionOrigin = region.GetIndex();
    auto regionSize = region.GetSize();

    object = std::make_shared<ObjectInformation>();
    object->scalar   = scalar;
    object->centroid = Vector3d(centroid[0] / spacing[0], centroid[1] / spacing[1], centroid[2] / spacing[2]);
    object->size     = labelObject->Size();
    object->min      = Vector3ui(regionOrigin[0], regionOrigin[1], regionOrigin[2]);
    object->max      = Vector3ui(regionSize[0] + regionOrigin[0], regionSize[1] + regionOrigin[1], regionSize[2] + regionOrigin[2]) - Vector3ui(1, 1, 1);

    ObjectVector.insert(std::pair<unsigned short, std::shared_ptr<ObjectInformation>>(i, object));

    // substract the voxels of this object from the background label
    ObjectVector[0]->size -= labelObject->Size();

    // need to mark object label as used to correct errors in the segmha metadata (defined labels but empty objects)
    metadata->markAsUsed(scalar);

    // flatten label
    labelChanger->SetChange(scalar, i);
  }

  // start entering new labels at the end of the scalar range
  m_firstFreeValue = GetScalarForLabel(GetNumberOfLabels() - 1) + 1;

  // apply all the changes made to labels
  labelChanger->Update();

  m_labelMap = LabelMapType::New();
  m_labelMap = labelChanger->GetOutput();
  m_labelMap->Optimize();
  m_labelMap->Update();

  // generate the initial vtkLookupTable
  m_lookupTable = vtkSmartPointer<vtkLookupTable>::New();
  GenerateLookupTable();
  m_lookupTable->Modified();
}
Ejemplo n.º 11
0
void CTexturePropDlg::On32BitSysCopy()
{
	SetChange(IDC_32BITSYSCOPY, TPROP_32BITSYSCOPY);
}
Ejemplo n.º 12
0
void CTexturePropDlg::OnFullbrite()
{
	SetChange(IDC_FULLBRITE, TPROP_FULLBRITES);
}
Ejemplo n.º 13
0
void CTexturePropDlg::OnNumMipmapsChange()
{
	SetChange(IDC_NUMBER_OF_MIPMAPS_TEXT, TPROP_NUMMIPMAPS);
}
Ejemplo n.º 14
0
void CTexturePropDlg::OnGroupChange()
{
	SetChange(IDC_TEXTURE_GROUP_TEXT, TPROP_GROUP);
}
Ejemplo n.º 15
0
void CTexturePropDlg::OnTexturePropChange()
{
	SetChange(IDC_TEXTUREPROP_FLAGS_TEXT, TPROP_FLAGS);
}
Ejemplo n.º 16
0
void CTexturePropDlg::OnChangeDetailTextureScale()
{
	SetChange(IDC_DETAILTEXTURESCALE_LABEL, TPROP_DETAILTEXTURESCALE);
}
Ejemplo n.º 17
0
void CTexturePropDlg::OnChangeDetailTextureAngle()
{
	SetChange(IDC_DETAILTEXTUREANGLE_LABEL, TPROP_DETAILTEXTUREANGLE);
}
Ejemplo n.º 18
0
void CTexturePropDlg::OnPrefer16Bit()
{
	SetChange(IDC_PREFER16BIT, TPROP_PREFER16BIT);
}