[Paraview] Volume positioning

Cory Quammen cory.quammen at kitware.com
Mon Nov 14 17:34:56 EST 2016


On Mon, Nov 14, 2016 at 5:25 PM, padraig <padraig.looney at gmail.com> wrote:
> I have been using the analyseniftiio plugin to open .nii files in paraview.

Ah, I see. I had forgotten about that one.

> In Slicer 4.6.2 they do not occupy the same physical space. The direction is
> different although the origin is the same.

I looked again in Slicer and you are right. Looking at
vtkNIfTIReader.cxx, the direction information seems to be ignored by
ParaView. Which makes sense because VTK and ParaView do not support
the concept of direction cosines, just origin and spacing. In
ParaView, you'll have to transform one of the volumes using the
Transform filter and scaling the Z direction by -1. Because the x and
y direction diagonals are also -1, you may want to scale those axes by
-1 as well.

HTH,
Cory

>
> Thanks
>
>
>
> On 14/11/16 22:11, Cory Quammen wrote:
>>
>> Are you somehow opening these files in ParaView? I was not able to
>> either gzipped or not, which is what I expect because ParaView does
>> not have a Nifti reader to my knowledge.
>>
>> In Slicer, which can open these files, the volumes are reported to
>> occupy the same space with an origin at (102.536, 106.413, 30.149).
>>
>> Please provide more details, step-by-step, about how you are viewing
>> these files in ParaView.
>>
>> Thanks,
>> Cory
>>
>> On Mon, Nov 14, 2016 at 10:29 AM, padraig <padraig.looney at gmail.com>
>> wrote:
>>>
>>> Attached are two volumes that have an overlap in paraview but the ITK
>>> volume
>>> I find using the code below means there should be no overlap
>>>
>>>
>>>
>>>
>>>
>>> On 14/11/16 15:09, Cory Quammen wrote:
>>>>
>>>> MHA and NIFTII definitely contain position information that ParaView
>>>> should read. Do you have any small-ish representative volumes you can
>>>> share (privately with me if needed).
>>>>
>>>> On Mon, Nov 14, 2016 at 10:04 AM, padraig <padraig.looney at gmail.com>
>>>> wrote:
>>>>>
>>>>> I have used MHA and NIFTII. I have converted the MHA into NIFTII using
>>>>> both
>>>>> c3d and ITK.
>>>>>
>>>>>
>>>>>
>>>>> On 14/11/16 14:59, Cory Quammen wrote:
>>>>>>
>>>>>> What file format are you using to load the volumes into ParaView? A
>>>>>> number of formats support volume positioning, so this should be
>>>>>> possible, unless you are loading a series of TIFF images, for example.
>>>>>>
>>>>>> Thanks,
>>>>>> Cory
>>>>>>
>>>>>> On Mon, Nov 14, 2016 at 5:32 AM, padraig <padraig.looney at gmail.com>
>>>>>> wrote:
>>>>>>>
>>>>>>> Dear list,
>>>>>>>
>>>>>>> I have been having problems with the positioning of volumes using
>>>>>>> Paraview.
>>>>>>> ITK tells me that, using,
>>>>>>>
>>>>>>>        IteratorType  it2( img_input,
>>>>>>> img_input->GetLargestPossibleRegion()
>>>>>>> );
>>>>>>>
>>>>>>>        it2.GoToBegin();
>>>>>>>        ImageType::IndexType begin = it2.GetIndex();
>>>>>>>        img_input->TransformIndexToPhysicalPoint(it2.GetIndex(),p0);
>>>>>>>        it2.GoToEnd();
>>>>>>>        --it2;
>>>>>>>        img_input->TransformIndexToPhysicalPoint(it2.GetIndex(),p1);
>>>>>>>        std::cout << p0 <<  p1 << std::endl;
>>>>>>>
>>>>>>>     two volumes I have have the positions
>>>>>>>
>>>>>>>
>>>>>>> [-102.536, -106.413, 30.1491][102.512, 106.414, 177.564]
>>>>>>>
>>>>>>> and
>>>>>>>
>>>>>>> [-102.536, -106.413, 30.1491][102.512, 106.414, -117.265]
>>>>>>>
>>>>>>> When I load these into Paraview they occupy the same volume. In
>>>>>>> Slicer3D
>>>>>>> the
>>>>>>> volumes are distinct as I expect above.
>>>>>>>
>>>>>>> Thanks
>>>>>>> Pádraig
>>>>>>> _______________________________________________
>>>>>>> Powered by www.kitware.com
>>>>>>>
>>>>>>> Visit other Kitware open-source projects at
>>>>>>> http://www.kitware.com/opensource/opensource.html
>>>>>>>
>>>>>>> Please keep messages on-topic and check the ParaView Wiki at:
>>>>>>> http://paraview.org/Wiki/ParaView
>>>>>>>
>>>>>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>>>>>
>>>>>>> Follow this link to subscribe/unsubscribe:
>>>>>>> http://public.kitware.com/mailman/listinfo/paraview
>>>>>>
>>>>>>
>>>>>>
>>>>
>>
>>
>



-- 
Cory Quammen
Staff R&D Engineer
Kitware, Inc.


More information about the ParaView mailing list