[Insight-developers] Adding pixel support for long long by testing with SimpleITK

Bradley Lowekamp blowekamp at mail.nih.gov
Fri Dec 23 11:50:44 EST 2011


Hello,

I brought up at this morning TCON the difficulties SimpleITK is having portable wrapping pixel types of uint64_t and int64_t. On many platforms these types are long long. There appears to be issues with the ConvertPixelBuffer, vnl_numeric_traits, and likely others.

The following little patch for SimpleITK enables these uint64_t and int64_t pixel types for all practical image filter that SimpleITK has wrapped. That is ~170 image filter that SimpleITK is currently wrapping will instantiate the ITK filter if it's can handle integer inputs.

diff --git a/Code/Common/include/sitkPixelIDTypeLists.h b/Code/Common/include/sitkPixelIDTypeLists.h
index 72fa4a1..6c65d21 100644
--- a/Code/Common/include/sitkPixelIDTypeLists.h
+++ b/Code/Common/include/sitkPixelIDTypeLists.h
@@ -28,8 +28,8 @@ typedef typelist::MakeTypeList<BasicPixelID<int8_t>,
                                BasicPixelID<uint16_t>,
                                BasicPixelID<int32_t>,
                                BasicPixelID<uint32_t>,
-//                               BasicPixelID<int64_t>,
-//                               BasicPixelID<uint64_t>,
+                               BasicPixelID<int64_t>,
+                               BasicPixelID<uint64_t>,
                                BasicPixelID<float>,
                                BasicPixelID<double> >::Type BasicPixelIDTypeList;
 
@@ -49,9 +49,9 @@ typedef typelist::MakeTypeList<BasicPixelID<int8_t>,
                                BasicPixelID<int16_t>,
                                BasicPixelID<uint16_t>,
                                BasicPixelID<int32_t>,
-                               BasicPixelID<uint32_t>//,
-//                               BasicPixelID<int64_t>,
-//                               BasicPixelID<uint64_t>
+                               BasicPixelID<uint32_t>,
+                               BasicPixelID<int64_t>,
+                               BasicPixelID<uint64_t>
                                >::Type IntegerPixelIDTypeList;
 
 
@@ -98,8 +98,8 @@ typedef typelist::MakeTypeList<VectorPixelID<float>,
  */
 typedef typelist::MakeTypeList<LabelPixelID<uint8_t>,
                                LabelPixelID<uint16_t>,
-                               LabelPixelID<uint32_t>//,
-//                               LabelPixelID<uint64_t>
+                               LabelPixelID<uint32_t>,
+                               LabelPixelID<uint64_t>
                                >::Type LabelPixelIDTypeList;
 
 /** List of all pixel ids available, but itk::LabelMap this include image of itk::Image,

Brad



========================================================
Bradley Lowekamp  
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20111223/a867788e/attachment.htm>


More information about the Insight-developers mailing list