# Resample DWI Volume

**URL:** <https://discourse.slicer.org/t/resample-dwi-volume/17941>\
**Category:** Support\
**Created:** [June 3, 2021, 9:49pm UTC](https://discourse.slicer.org/t/resample-dwi-volume/17941 "2021-06-03T21:49:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nadya\_Shusharina](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nadya_shusharina/32/9186_2.png) [@Nadya\_Shusharina](https://discourse.slicer.org/u/Nadya_Shusharina)\
**Post date:** [June 3, 2021, 9:49pm UTC](https://discourse.slicer.org/t/resample-dwi-volume/17941/1 "2021-06-03T21:49:40Z")

</div>

I am using Resample Scalar/Vector/DWI Volume module to simply upsample the image. The Apply button runs the process of resampling with the status “Completed” after about 25 sec. However, the output resampled volume is not being written/displayed.

I am using nrrd input and Manual Output Parameters.

What am I missing?

Thank you!

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [June 4, 2021, 1:57am UTC](https://discourse.slicer.org/t/resample-dwi-volume/17941/2 "2021-06-04T01:57:29Z")

</div>

What do you see in the application log?

Does it make a difference if you enable “Prefer executable CLI” in application settings / modules?

---

<div class="post-metadata">

**Author:** ![Nadya\_Shusharina](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nadya_shusharina/32/9186_2.png) [@Nadya\_Shusharina](https://discourse.slicer.org/u/Nadya_Shusharina)\
**Post date:** [June 7, 2021, 1:43pm UTC](https://discourse.slicer.org/t/resample-dwi-volume/17941/3 "2021-06-07T13:43:34Z")

</div>

“Prefer executable CLI” is ON.

The message is “Unsupported number of components (only 1 allowed): 168”

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 7, 2021, 2:55pm UTC](https://discourse.slicer.org/t/resample-dwi-volume/17941/4 "2021-06-07T14:55:26Z")

</div>

In Slicer is the input volume loaded as a diffusion volume? (check in the Volumes module if you can scroll through the gradient images). Otherwise maybe you can share a dataset with steps for reproducing.

---

<div class="post-metadata">

**Author:** ![Nadya\_Shusharina](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nadya_shusharina/32/9186_2.png) [@Nadya\_Shusharina](https://discourse.slicer.org/u/Nadya_Shusharina)\
**Post date:** [June 7, 2021, 2:58pm UTC](https://discourse.slicer.org/t/resample-dwi-volume/17941/5 "2021-06-07T14:58:55Z")

</div>

Yes, I can see all components. How do I share?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 7, 2021, 6:08pm UTC](https://discourse.slicer.org/t/resample-dwi-volume/17941/6 "2021-06-07T18:08:21Z")

</div>

You can put it on google drive, dropbox, or similar and share the link here.

---

<div class="post-metadata">

**Author:** ![Nadya\_Shusharina](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nadya_shusharina/32/9186_2.png) [@Nadya\_Shusharina](https://discourse.slicer.org/u/Nadya_Shusharina)\
**Post date:** [June 8, 2021, 2:46am UTC](https://discourse.slicer.org/t/resample-dwi-volume/17941/7 "2021-06-08T02:46:28Z")

</div>

Here is the link.

> **[DTI\_legs](https://www.dropbox.com/sh/b7odxcgdv89fwsy/AAAS7eKnFI04nvzHykaameuea?dl=0)**
>
> Shared with Dropbox

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 9, 2021, 2:42am UTC](https://discourse.slicer.org/t/resample-dwi-volume/17941/8 "2021-06-09T02:42:11Z")

</div>

Thanks for reporting this and providing the data to replicate it @Nadya_Shusharina.

It appears the problem is that the CLI read-back mechanism is not detecting the resampled data as DWI and so it fails to load. As I recall this used to work but I haven’t seen it used in a while.

```auto

Found CommandLine Module, target is /Applications/Slicer-4.11.20210226.app/Contents/lib/Slicer-4.11/cli-modules/ResampleScalarVectorDWIVolume
ModuleType: CommandLineModule
Resample Scalar/Vector/DWI Volume command line: 

/Applications/Slicer-4.11.20210226.app/Contents/lib/Slicer-4.11/cli-modules/ResampleScalarVectorDWIVolume --transformationFile /private/var/folders/0y/yzydqvk90f9_kx1sqd3k110h0000gn/T/Slicer-pieper/GJHED_vtkMRMLLinearTransformNodeE.h5 --hfieldtype h-Field --interpolation linear --transform_order output-to-input --image_center input --spacing 0,0,0 --size 0,0,0 --direction_matrix 0,0,0,0,0,0,0,0,0 --number_of_thread 0 --default_pixel_value 0 --window_function c --spline_order 3 --transform_matrix 1,0,0,0,1,0,0,0,1,0,0,0 --transform a /private/var/folders/0y/yzydqvk90f9_kx1sqd3k110h0000gn/T/Slicer-pieper/GJHED_vtkMRMLDiffusionWeightedVolumeNodeB.nrrd /private/var/folders/0y/yzydqvk90f9_kx1sqd3k110h0000gn/T/Slicer-pieper/GJHED_vtkMRMLScalarVolumeNodeB.nrrd 

Resample Scalar/Vector/DWI Volume completed without errors

UpdateFromFile: Unsupported number of components (only 1 allowed): 168

ReadDataInternal: Cannot read file as a volume of type Volume[fullName = /private/var/folders/0y/yzydqvk90f9_kx1sqd3k110h0000gn/T/Slicer-pieper/GJHED_vtkMRMLScalarVolumeNodeB.nrrd]
	Number of files listed in the node = 0.
	File reader says it was able to read 1 files.
	File reader used the archetype file name of /private/var/folders/0y/yzydqvk90f9_kx1sqd3k110h0000gn/T/Slicer-pieper/GJHED_vtkMRMLScalarVolumeNodeB.nrrd [reader 0th file name = /private/var/folders/0y/yzydqvk90f9_kx1sqd3k110h0000gn/T/Slicer-pieper/GJHED_vtkMRMLScalarVolumeNodeB.nrrd]
FileFormatError

vtkMRMLStorageNode::ReadData: Failed to read node Output Volume (vtkMRMLScalarVolumeNode1) from filename='/private/var/folders/0y/yzydqvk90f9_kx1sqd3k110h0000gn/T/Slicer-pieper/GJHED_vtkMRMLScalarVolumeNodeB.nrrd'

Input port 0 of algorithm vtkImageMapToWindowLevelColors(0x7ff9223662f0) has 0 connections but is not optional.

```

This is a bug so I [reported an issue](https://github.com/Slicer/Slicer/issues/5684) to track it.

As a workaround you can enable the “Preserve CLII module data files” flag in the Application Settings → Developer panel and then open the result of the CLI using the regular Add Data dialog. The output is the last filename on the CLI command line (/private/var/folders/0y/yzydqvk90f9\_kx1sqd3k110h0000gn/T/Slicer-pieper/GJHED\_vtkMRMLScalarVolumeNodeB.nrrd  
in this case),

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/f/6f4a902b62de6c4ad606e6bc4702048ab8db1e95.png)

---

<div class="post-metadata">

**Author:** ![Nadya\_Shusharina](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/nadya_shusharina/32/9186_2.png) [@Nadya\_Shusharina](https://discourse.slicer.org/u/Nadya_Shusharina)\
**Post date:** [June 9, 2021, 1:44pm UTC](https://discourse.slicer.org/t/resample-dwi-volume/17941/9 "2021-06-09T13:44:26Z")

</div>

Thank you, Steve. I recall some other cases in DMRI where the output volume does not load if I specify “Create new Volume as …”.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [June 9, 2021, 1:56pm UTC](https://discourse.slicer.org/t/resample-dwi-volume/17941/10 "2021-06-09T13:56:04Z")

</div>

Ah, yes, thanks for the reminder. I really haven’t used this in a long time.

You do need to select the correct node type for the output in order for it to load correctly. This is different from the Add Data path which tries many different types to figure out what type of file is being read back.

So in this case if I create a DiffusionWeightedVolume the result loads back correctly.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/b/2/b2206ac90f771a286c0e4757e89debcb0e94ec48.png)

This is an odd usability issue, but maybe not technically a bug given the design of the CLI intertace. Probably a small scripted module on top of the CLI could automated some of these data dependencies.
