[vtkusers] vtkDICOMImageReader holds the last image in memory?
Jose Barreto
jose.de.paula at live.com
Tue Jun 23 15:10:51 EDT 2015
Hello users,
I am using vtkDICOMImageReader-> SetDirectoryName ();
So far so good, it work normally, the problem is that when peopl to delete
it from memory he holds the last image in the folder that is pointing.
Ete is my code
if (dicomReader != nullptr)
{
dicomReader->GetOutput()->Delete();
dicomReader->SetDirectoryName("");
dicomReader = nullptr;
System::GC::Collect();
clXUteis::ControleDICOM();
}
The method moves all directory of images that sent the vtkDICOMImageReader
open to another folder. All images are moved, minus the last image that
gives me the error ("The file is being used by another application").
If I repeat the precession, again the last image was left behind.
void clXUteis::ControleDICOM()
{
DirectoryInfo^ Dir = gcnew
DirectoryInfo(DadosRequisicao::local_arquivo_DICOM + "temp\\");
array<FileInfo^>^ fileInfo = Dir->GetFiles("*.dcm");
try
{
for (int i = 0; i < fileInfo->Length; i++)
{
//Retira o diretório
String^ fileName = fileInfo[i]->FullName->Replace(Dir->FullName, "");
File::Move(fileInfo[i]->FullName, DadosRequisicao::local_arquivo_DICOM +
fileName);
delete fileName;
}
}
catch (Exception^ ex)
{
MessageBox::Show(ex->Message);
}
finally{
Dir = nullptr;
delete fileInfo;
}
}
I can not drop this last image vtkDICOMImageReader.
--
View this message in context: http://vtk.1045678.n5.nabble.com/vtkDICOMImageReader-holds-the-last-image-in-memory-tp5732506.html
Sent from the VTK - Users mailing list archive at Nabble.com.
More information about the vtkusers
mailing list