Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading multi-pass CT series #220

Open
dgobbi opened this issue Apr 18, 2023 · 3 comments
Open

Reading multi-pass CT series #220

dgobbi opened this issue Apr 18, 2023 · 3 comments

Comments

@dgobbi
Copy link
Owner

dgobbi commented Apr 18, 2023

Recently I've seen more and more CT scans that include multiple passes within the same series. Logically, each pass forms a separate stack, but with legacy DICOM files there's no clear indication of which files belong to which stack. However, it should be possible to detect discontinuities in the spacing and use these to identify the transitions from one pass to the next.

@dgobbi
Copy link
Owner Author

dgobbi commented Jul 12, 2023

Further notes on this problem. When dicomtonifti encounters these multi-pass images, then if all images have the same orientation, it forces all the images to into a single stack. The resulting stack is distorted (stretched in the overlap region and compressed elsewhere) and definitely cannot be considered a valid/correct conversion.

So far, for all the multi-pass CT's that I've seen, each pass has a different AcquisitionNumber. And by splitting the series according to acquisition number before reconstruction, I'm able to generate a separate (and correct) volume for each stack. However, I don't know if this will always work.

@eightysix
Copy link

Further notes on this problem. When dicomtonifti encounters these multi-pass images, then if all images have the same orientation, it forces all the images to into a single stack. The resulting stack is distorted (stretched in the overlap region and compressed elsewhere) and definitely cannot be considered a valid/correct conversion.

So far, for all the multi-pass CT's that I've seen, each pass has a different AcquisitionNumber. And by splitting the series according to acquisition number before reconstruction, I'm able to generate a separate (and correct) volume for each stack. However, I don't know if this will always work.

Hello David. Can you provide a code example on how to split the series according to acquisition number?

@dgobbi
Copy link
Owner Author

dgobbi commented May 22, 2024

There's two ways to do this. One is to separate the acquisitions into different directories before reading them. This requires using the command-line tools. Let's say that the DICOMS are in a directory called "series_folder":

$ dicomtocsv --all-unique -k AcquisitionNumber -k SeriesInstanceUID series_folder/
"1\2\3","1.3.6.1.4.1.5962.1.3.50.1.1166562673.14401"
"4\5\6","1.3.6.1.4.1.5962.1.3.50.2.1166562673.14401"

This indicates two series (identified by their UIDs), where one series has acquisitions 1,2,3 and the other has acquisitions 4,5,6. The first acquisition can be split into a new directory like this:

$ mkdir acq_folder1
$ dicompull -k AcquisitionNumber=1 -o acq_folder1/ series_folder/

If you want to do the separation in a C++ program, the vtkDICOMDirectory class can be used to select the DICOM files that belong to just one of the acquisitions:

  // specify the acquisition number to read
  vtkDICOMItem query;
  query.Set(DC::AcquisitionNumber, 1);

  auto selector = vtkSmartPointer<vtkDICOMDirectory>::New();
  selector->SetFindQuery(query);
  selector->SetDirectoryName(dirname);
  selector->Update();

  auto reader = vtkSmartPointer<vtkDICOMReader>::New();
  reader->SetFileNames(selector->GetFileNamesForSeries(0));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants