Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
151 changes: 151 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
## This config file is only relevant for clang-format version 8.0.0
##
## Examples of each format style can be found on the in the clang-format documentation
## See: https://clang.llvm.org/docs/ClangFormatStyleOptions.html for details of each option
##
## The clang-format binaries can be downloaded as part of the clang binary distributions
## from http://releases.llvm.org/download.html
##
## Use the script Utilities/Maintenance/clang-format.bash to faciliate
## maintaining a consistent code style.
##
## EXAMPLE apply code style enforcement before commit:
# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --modified
## EXAMPLE apply code style enforcement after commit:
# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --last
---
# This configuration requires clang-format version 8.0.0 exactly.
BasedOnStyle: Mozilla
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: true
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
# clang 9.0 AllowAllArgumentsOnNextLine: true
# clang 9.0 AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Inline
# clang 9.0 AllowShortLambdasOnASingleLine: All
# clang 9.0 features AllowShortIfStatementsOnASingleLine: Never
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: All
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakBeforeBraces: Custom
BraceWrapping:
# clang 9.0 feature AfterCaseLabel: false
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
## This is the big change from historical ITK formatting!
# Historically ITK used a style similar to https://en.wikipedia.org/wiki/Indentation_style#Whitesmiths_style
# with indented braces, and not indented code. This style is very difficult to automatically
# maintain with code beautification tools. Not indenting braces is more common among
# formatting tools.
IndentBraces: false
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
BreakBeforeBinaryOperators: None
#clang 6.0 BreakBeforeInheritanceComma: true
BreakInheritanceList: BeforeComma
BreakBeforeTernaryOperators: true
#clang 6.0 BreakConstructorInitializersBeforeComma: true
BreakConstructorInitializers: BeforeComma
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
## The following line allows larger lines in non-documentation code
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 2
ContinuationIndentWidth: 2
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
- Regex: '.*'
Priority: 1
IncludeIsMainRegex: '(Test)?$'
IndentCaseLabels: true
IndentPPDirectives: AfterHash
IndentWidth: 2
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: false
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
## The following line allows larger lines in non-documentation code
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 200
PointerAlignment: Middle
ReflowComments: true
# We may want to sort the includes as a separate pass
SortIncludes: false
# We may want to revisit this later
SortUsingDeclarations: false
SpaceAfterCStyleCast: false
# SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 2
UseTab: Never
...
14 changes: 14 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Custom attribute to mark sources as using our C++/C code style.
[attr]our-c-style whitespace=tab-in-indent,no-lf-at-eof hooks.style=KWStyle,clangformat

*.c our-c-style
*.h our-c-style
*.cxx our-c-style
*.hxx our-c-style
*.txx our-c-style
*.txt whitespace=tab-in-indent,no-lf-at-eof
*.cmake whitespace=tab-in-indent,no-lf-at-eof

# ExternalData content links must have LF newlines
*.md5 crlf=input
*.sha512 crlf=input
2 changes: 1 addition & 1 deletion CTestConfig.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(CTEST_PROJECT_NAME "ITK")
set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC")

set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_METHOD "https")
set(CTEST_DROP_SITE "open.cdash.org")
set(CTEST_DROP_LOCATION "/submit.php?project=Insight")
set(CTEST_DROP_SITE_CDASH TRUE)
94 changes: 51 additions & 43 deletions include/itkCartesianToPolarTransform.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*=========================================================================
*
* Copyright Insight Software Consortium
* Copyright NumFOCUS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -47,31 +47,30 @@ namespace itk
*
* Dimension must be at least 2.
*
* \author Jakub Bican, Department of Image Processing, Institute of Information Theory and Automation, Academy of Sciences of the Czech Republic.
* \author Jakub Bican, Department of Image Processing, Institute of Information Theory and Automation, Academy of
* Sciences of the Czech Republic.
*
* \ingroup Transforms
* \ingroup PolarTransform
*/
template <
typename TParametersValueType=double, // Data type for scalars (float or double)
unsigned int NDimensions=3> // Number of dimensions
class ITK_TEMPLATE_EXPORT CartesianToPolarTransform :
public Transform< TParametersValueType, NDimensions, NDimensions >
template <typename TParametersValueType = double, // Data type for scalars (float or double)
unsigned int NDimensions = 3> // Number of dimensions
class ITK_TEMPLATE_EXPORT CartesianToPolarTransform : public Transform<TParametersValueType, NDimensions, NDimensions>
{
public:
ITK_DISALLOW_COPY_AND_ASSIGN(CartesianToPolarTransform);

/** Standard class type alias. */
using Self = CartesianToPolarTransform;
using Superclass = Transform< TParametersValueType, NDimensions, NDimensions >;
using Pointer = SmartPointer< Self >;
using ConstPointer = SmartPointer< const Self >;
using Superclass = Transform<TParametersValueType, NDimensions, NDimensions>;
using Pointer = SmartPointer<Self>;
using ConstPointer = SmartPointer<const Self>;

/** New macro for creation of through the object factory.*/
itkNewMacro( Self );
itkNewMacro(Self);

/** Run-time type information (and related methods). */
itkTypeMacro( CartesianToPolarTransform, Transform );
itkTypeMacro(CartesianToPolarTransform, Transform);

/** Dimension of the domain space. */
static constexpr unsigned int SpaceDimension = NDimensions;
Expand Down Expand Up @@ -106,61 +105,69 @@ class ITK_TEMPLATE_EXPORT CartesianToPolarTransform :
* This method transforms first two dimensions of a point from cartesian
* coordinates to polar coordinates <alpha,radius>.
*/
OutputPointType TransformPoint(const InputPointType &point ) const override;
OutputPointType
TransformPoint(const InputPointType & point) const override;

/** Method to transform a vector - not applicable for this type of transform. */
OutputVectorType TransformVector(const InputVectorType &) const override
{
OutputVectorType
TransformVector(const InputVectorType &) const override
{
itkExceptionMacro(<< "Method not applicable for this type of transform.");
return OutputVectorType();
}
}

/** Method to transform a vnl_vector - not applicable for this type of transform. */
OutputVnlVectorType TransformVector(const InputVnlVectorType &) const override
{
OutputVnlVectorType
TransformVector(const InputVnlVectorType &) const override
{
itkExceptionMacro(<< "Method not applicable for this type of transform.");
return OutputVnlVectorType();
}
}

/** Method to transform a vector - not applicable for this type of transform. */
typename Superclass::OutputVectorPixelType TransformVector(
const typename Superclass::InputVectorPixelType &, const InputPointType &) const override
{
typename Superclass::OutputVectorPixelType
TransformVector(const typename Superclass::InputVectorPixelType &, const InputPointType &) const override
{
itkExceptionMacro(<< "Method not applicable for this type of transform.");
return typename Superclass::OutputVectorPixelType();
}
}

using Superclass::TransformVector;

/** Method to transform a CovariantVector - not applicable for this type of transform. */
OutputCovariantVectorType TransformCovariantVector(
const InputCovariantVectorType &) const override
{
OutputCovariantVectorType
TransformCovariantVector(const InputCovariantVectorType &) const override
{
itkExceptionMacro(<< "Method not applicable for this type of transform.");
return OutputCovariantVectorType();
}
}

using Superclass::TransformCovariantVector;

void ComputeJacobianWithRespectToParameters( const InputPointType &, JacobianType & ) const override
{
void
ComputeJacobianWithRespectToParameters(const InputPointType &, JacobianType &) const override
{
itkExceptionMacro(<< "Method not implemented yet.");
}
}

void SetParameters(const ParametersType &) override {}
void
SetParameters(const ParametersType &) override
{}

void SetFixedParameters(const ParametersType &) override {}
void
SetFixedParameters(const ParametersType &) override
{}

/** Set the location of the center of the polar coordinate system. */
itkSetMacro( Center, InputPointType );
itkGetConstReferenceMacro( Center, InputPointType );
itkSetMacro(Center, InputPointType);
itkGetConstReferenceMacro(Center, InputPointType);

/** Set an angular offset for the polar coordinate transform.
/** Set an angular offset for the polar coordinate transform.
*
* Defaults to 0.0
*/
itkSetMacro( AngleOffset, typename OutputPointType::ValueType );
itkGetConstReferenceMacro( AngleOffset, typename OutputPointType::ValueType );
itkSetMacro(AngleOffset, typename OutputPointType::ValueType);
itkGetConstReferenceMacro(AngleOffset, typename OutputPointType::ValueType);

/** Enable/Disable to use constant arc increment instead of constant angular increment.
*
Expand All @@ -175,19 +182,20 @@ class ITK_TEMPLATE_EXPORT CartesianToPolarTransform :
~CartesianToPolarTransform() override;

/** Print contents of an CartesianToPolarTransform. */
void PrintSelf(std::ostream &os, Indent indent) const override;
void
PrintSelf(std::ostream & os, Indent indent) const override;

private:
InputPointType m_Center;
InputPointType m_Center;
typename OutputPointType::ValueType m_AngleOffset = 0;
bool m_ConstArcIncr = false;
}; //class CartesianToPolarTransform
bool m_ConstArcIncr = false;
}; // class CartesianToPolarTransform

} // namespace itk
} // namespace itk


#ifndef ITK_MANUAL_INSTANTIATION
#include "itkCartesianToPolarTransform.hxx"
# include "itkCartesianToPolarTransform.hxx"
#endif

#endif
Loading